PHP Класс seregazhuk\PinterestBot\Api\ProvidersContainer

Наследование: implements seregazhuk\PinterestBot\Contracts\ProvidersContainerInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$providers array A array containing the cached providers.
$request Request References to the request that travels through the application.
$response Response

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
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

Описание методов

__construct() публичный Метод

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

addProvider() защищенный Метод

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() защищенный Метод

Build Provider object with reflection API.
protected buildProvider ( string $className ) : object
$className string
Результат object

getClientInfo() публичный Метод

Simply proxies call to Response object.
public getClientInfo ( ) : array | null
Результат array | null

getHttpClient() публичный Метод

Returns HttpClient object for setting user-agent string or other CURL available options.
public getHttpClient ( ) : seregazhuk\PinterestBot\Api\Contracts\HttpClient
Результат seregazhuk\PinterestBot\Api\Contracts\HttpClient

getLastError() публичный Метод

Proxies call to Request object and returns message from the error object.
public getLastError ( ) : string | null
Результат string | null

getProvider() публичный Метод

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
Результат seregazhuk\PinterestBot\Api\Providers\Provider

resolveProviderClass() защищенный Метод

protected resolveProviderClass ( $provider ) : string
$provider
Результат string

Описание свойств

$providers защищенное свойство

A array containing the cached providers.
protected array $providers
Результат array

$request защищенное свойство

References to the request that travels through the application.
protected Request,seregazhuk\PinterestBot\Api $request
Результат Request

$response защищенное свойство

protected Response,seregazhuk\PinterestBot\Api $response
Результат Response