PHP Class Phue\Transport\Http

Inheritance: implements Phue\Transport\TransportInterface
Afficher le fichier Open project: sqmk/phue

Méthodes publiques

Свойство Type Description
$exceptionMap array Exception map

Protected Properties

Свойство Type Description
$adapter Phue\Transport\Adapter\AdapterInterface Adapter
$client Phue\Client Phue Client

Méthodes publiques

Méthode Description
__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

Méthodes protégées

Méthode Description
getJsonResponse ( string $address, string $method = self::METHOD_GET, stdClass $body = null ) : stdClass Send request

Method Details

__construct() public méthode

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

getAdapter() public méthode

Auto created adapter if one is not present
public getAdapter ( ) : Phue\Transport\Adapter\AdapterInterface
Résultat Phue\Transport\Adapter\AdapterInterface Adapter

getExceptionByType() public méthode

Get exception by type
public getExceptionByType ( string $type, string $description ) : Exception
$type string Error type
$description string Description of error
Résultat Exception Built exception

getJsonResponse() protected méthode

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
Résultat stdClass Json body

sendRequest() public méthode

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
Résultat string Request response

sendRequestBypassBodyValidation() public méthode

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
Résultat string Request response

setAdapter() public méthode

Set adapter
public setAdapter ( Phue\Transport\Adapter\AdapterInterface $adapter ) : self
$adapter Phue\Transport\Adapter\AdapterInterface Transport adapter
Résultat self This object

Property Details

$adapter protected_oe property

Adapter
protected AdapterInterface,Phue\Transport\Adapter $adapter
Résultat Phue\Transport\Adapter\AdapterInterface

$client protected_oe property

Phue Client
protected Client,Phue $client
Résultat Phue\Client

$exceptionMap public_oe static_oe property

Exception map
public static array $exceptionMap
Résultat array