PHP Класс Phue\Transport\Http

Наследование: implements Phue\Transport\TransportInterface
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$exceptionMap array Exception map

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

Свойство Тип Описание
$adapter Phue\Transport\Adapter\AdapterInterface Adapter
$client Phue\Client Phue Client

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

Метод Описание
__construct ( Client $client ) Construct Http transport
getAdapter ( ) : Phue\Transport\Adapter\AdapterInterface Get adapter for transport
getExceptionByType ( string $type, string $description ) : Exception Get exception by type
sendRequest ( string $address, string $method = self::METHOD_GET, stdClass $body = null ) : string Send request
sendRequestBypassBodyValidation ( string $address, string $method = self::METHOD_GET, stdClass $body = null ) : string Send request, bypass body validation
setAdapter ( Phue\Transport\Adapter\AdapterInterface $adapter ) : self Set adapter

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

Метод Описание
getJsonResponse ( string $address, string $method = self::METHOD_GET, stdClass $body = null ) : stdClass Send request

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

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

Construct Http transport
public __construct ( Client $client )
$client Phue\Client

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

Auto created adapter if one is not present
public getAdapter ( ) : Phue\Transport\Adapter\AdapterInterface
Результат Phue\Transport\Adapter\AdapterInterface Adapter

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

Get exception by type
public getExceptionByType ( string $type, string $description ) : Exception
$type string Error type
$description string Description of error
Результат Exception Built exception

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

Send request
protected getJsonResponse ( string $address, string $method = self::METHOD_GET, stdClass $body = null ) : stdClass
$address string API address
$method string Request method
$body stdClass Post body
Результат stdClass Json body

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

Send request
public sendRequest ( string $address, string $method = self::METHOD_GET, stdClass $body = null ) : string
$address string API address
$method string Request method
$body stdClass Post body
Результат string Request response

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

Send request, bypass body validation
public sendRequestBypassBodyValidation ( string $address, string $method = self::METHOD_GET, stdClass $body = null ) : string
$address string API address
$method string Request method
$body stdClass Post body
Результат string Request response

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

Set adapter
public setAdapter ( Phue\Transport\Adapter\AdapterInterface $adapter ) : self
$adapter Phue\Transport\Adapter\AdapterInterface Transport adapter
Результат self This object

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

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

Adapter
protected AdapterInterface,Phue\Transport\Adapter $adapter
Результат Phue\Transport\Adapter\AdapterInterface

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

Phue Client
protected Client,Phue $client
Результат Phue\Client

$exceptionMap публичное статическое свойство

Exception map
public static array $exceptionMap
Результат array