PHPackages                             rgarman/sdk-stats - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rgarman/sdk-stats

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rgarman/sdk-stats
=================

Stats.com general Info SDK

1.2.0(6y ago)117MITPHP

Since Sep 3Pushed 6y ago1 watchersCompare

[ Source](https://github.com/namrag10/stats-sdk)[ Packagist](https://packagist.org/packages/rgarman/sdk-stats)[ RSS](/packages/rgarman-sdk-stats/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (6)Used By (0)

Stats.com SDK
=============

[](#statscom-sdk)

About
-----

[](#about)

The `sdk-stats` package is an Software Development Kit for various stats.com API endpoints. The way this SDK works is by the user customising the endpoints to use and assign their own names to them for easier and more efficient experience for the developer

Installation
------------

[](#installation)

Require the `rgarman/sdk-stats` package in your `composer.json` and update your dependencies:

```
composer require rgarman/sdk-stats
```

Creating a Client:
------------------

[](#creating-a-client)

I would recommend that an assoc array containing your login credentials is created, for ease later. This also will aid in creating multiple different instances with different API's simultaniously Create an instance of the ClientCore() class

```
use RGarman\Stats\statsClient;

// A config of ["{your username}", "{your password}"] would work too!
$Configs = [
    "Stats" => [
        "{USERNAME}",
        "{PASSWORD}"
    ],
    ...
]

$StatsClient = new ClientCore();
```

Adding Resources
----------------

[](#adding-resources)

To add a Resource to use, simply call the AddResource() method from the ClientCore and pass an instance of either a Route, or Cache

---

The parameters to which are: the name, and the chosen instance Route parameters:

1. Endpoint (String)
2. Parameters (Array)
3. Config Credentials

```
// Generate a new endpoint resource
$StatsClient->AddResource("SquadList", new Route("api/RU/clubSquads/", ["Competition ID", "Season ID", "Team ID"], $Configs["Stats"]));

//Generate a new Cache interface
$StatsClient->AddResource("Caching", new Cache());
```

Using the Resources
-------------------

[](#using-the-resources)

Using the name you assigned the resource, simply use it as a property and use any of the below listed functions

```
//This outputs the Squad List for England in the Six Nations 2019 and generates a cache containing the response from the API
var_dump($StatsClient->SquadList->getAndCache([301, 2019, 1114]));

//Using the "Caching" resource (previously created), we can see all of the cached data using:
var_dump($StatsClient->Caching->get("*"));

//The name of the above cache is called "api-RU-clubSquads-301-2019-1114", so to get this data, we use the following:
var_dump($StatsClient->Caching->get("api-RU-clubSquads-301-2019-1114"));
```

Function List
=============

[](#function-list)

Route Instance:
---------------

[](#route-instance)

#### get( $Parameters (Array/String) )

[](#get--parameters-arraystring--)

##### makes a call to the current API endpoint selected using the Parameters provided as an array or string
Returns the response from the API as an array

[](#makes-a-call-to-the-current-api-endpoint-selected-using-the-parameters-provided-as-an-array-or-stringreturns-the-response-from-the-api-as-an-array)

#### getAndCache ( $Parameters (Array/String) )

[](#getandcache---parameters-arraystring--)

##### Basically the same functionality as **get**, except for the fact that a cache will be createdin the form of raw `JSON`
Returns the response from the API as an array (In addition to the cache)

[](#basically-the-same-functionality-as-get-except-for-the-fact-that-a-cache-will-be-createdin-the-form-of-raw-jsonreturns-the-response-from-the-api-as-an-array-in-addition-to-the-cache)

#### setMethod( $Method (String) )

[](#setmethod-method-string--)

##### Sets the type of HTTP protocol to use e.g. GET, POST, PUT etc. Accepts all 7 types

[](#sets-the-type-of-http-protocol-to-use-eg-get-post-put-etc-accepts-all-7-types)

#### setBase( $Base (String) )

[](#setbase--base-string--)

##### Sets the Base URI of the API to use, so other API's can be used within the same SDK!

[](#sets-the-base-uri-of-the-api-to-use-so-other-apis-can-be-used-within-the-same-sdk)

- -

Cache Instance:
---------------

[](#cache-instance)

#### get( $Cache (String) )

[](#get--cache-string--)

##### Retreives the given cache, use `"*"` to get the names of all stored cached data

[](#retreives-the-given-cache-use--to-get-the-names-of-all-stored-cached-data)

---

See the Example for more

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity62

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

5

Last Release

2440d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a7e34f0e72698f84719749438417943ac9ec791b9491ae0c8e7840f07b985b95?d=identicon)[rgarman](/maintainers/rgarman)

### Embed Badge

![Health badge](/badges/rgarman-sdk-stats/health.svg)

```
[![Health](https://phpackages.com/badges/rgarman-sdk-stats/health.svg)](https://phpackages.com/packages/rgarman-sdk-stats)
```

###  Alternatives

[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[ralphjsmit/laravel-helpers

A package containing handy helpers for your Laravel-application.

13704.6k2](/packages/ralphjsmit-laravel-helpers)[dhlparcel/magento2-plugin

DHL Parcel plugin for Magento 2

11180.5k2](/packages/dhlparcel-magento2-plugin)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
