Method |
Description |
|
__construct ( array $config ) |
Initializes configuration parameters and resources |
|
__get ( $resource ) : Snorlax\Resource |
Allows us to use $client->resource so we don't need to call
$client->getResource($resource) every time |
|
addResources ( array $resources ) |
Appends the given resources to the ones already being used |
|
getOriginalClient ( ) : GuzzleHttp\ClientInterface |
Returns the internal client |
|
getResource ( string $resource ) : Snorlax\Resource |
Instantiates and returns the asked resource. |
|
request ( string $method, string | Psr\Http\Message\UriInterface $uri, array $options = [] ) : Psr\Http\Message\ResponseInterface |
|
|
setAuthorization ( Snorlax\Auth\Authorization $auth ) |
Changes the authentication method on all the requests made by this client |
|
setClient ( array $config ) |
Sets the client according to the given $config array, following the rules:
- If no custom client is given, instantiates a new GuzzleHttp\Client
- If an instance of GuzzleHttp\ClientInterface is given, we only pass it through
- If a closure is given, it gets executed receiving the parameters given |
|