PHP Class seregazhuk\PinterestBot\Api\ProvidersContainer

Inheritance: implements seregazhuk\PinterestBot\Contracts\ProvidersContainerInterface
Afficher le fichier Open project: seregazhuk/php-pinterest-bot Class Usage Examples

Protected Properties

Свойство Type Description
$providers array A array containing the cached providers.
$request Request References to the request that travels through the application.
$response Response

Méthodes publiques

Méthode Description
__construct ( Request $request, Response $response )
getClientInfo ( ) : array | null Simply proxies call to Response object.
getHttpClient ( ) : seregazhuk\PinterestBot\Api\Contracts\HttpClient Returns HttpClient object for setting user-agent string or other CURL available options.
getLastError ( ) : string | null Proxies call to Request object and returns message from the error object.
getProvider ( string $provider ) : Provider Gets provider object by name. If there is no such provider in providers array, it will try to create it, then save it, and then return.

Méthodes protégées

Méthode Description
addProvider ( string $provider ) Creates provider by class name, and if success saves it to providers array. Provider class must exist in PROVIDERS_NAMESPACE.
buildProvider ( string $className ) : object Build Provider object with reflection API.
resolveProviderClass ( $provider ) : string

Method Details

__construct() public méthode

public __construct ( Request $request, Response $response )
$request Request
$response Response

addProvider() protected méthode

Creates provider by class name, and if success saves it to providers array. Provider class must exist in PROVIDERS_NAMESPACE.
protected addProvider ( string $provider )
$provider string

buildProvider() protected méthode

Build Provider object with reflection API.
protected buildProvider ( string $className ) : object
$className string
Résultat object

getClientInfo() public méthode

Simply proxies call to Response object.
public getClientInfo ( ) : array | null
Résultat array | null

getHttpClient() public méthode

Returns HttpClient object for setting user-agent string or other CURL available options.
public getHttpClient ( ) : seregazhuk\PinterestBot\Api\Contracts\HttpClient
Résultat seregazhuk\PinterestBot\Api\Contracts\HttpClient

getLastError() public méthode

Proxies call to Request object and returns message from the error object.
public getLastError ( ) : string | null
Résultat string | null

getProvider() public méthode

Gets provider object by name. If there is no such provider in providers array, it will try to create it, then save it, and then return.
public getProvider ( string $provider ) : Provider
$provider string
Résultat seregazhuk\PinterestBot\Api\Providers\Provider

resolveProviderClass() protected méthode

protected resolveProviderClass ( $provider ) : string
$provider
Résultat string

Property Details

$providers protected_oe property

A array containing the cached providers.
protected array $providers
Résultat array

$request protected_oe property

References to the request that travels through the application.
protected Request,seregazhuk\PinterestBot\Api $request
Résultat Request

$response protected_oe property

protected Response,seregazhuk\PinterestBot\Api $response
Résultat Response