\GuzzleHttp\Command\GuzzleDeserializer

Handler used to create response models based on an HTTP response and a service description.

Response location visitors are registered with this Handler to handle locations (e.g., 'xml', 'json', 'header'). All of the locations of a response model that will be visited first have their before method triggered. After the before method is called on every visitor that will be walked, each visitor is triggered using the visit() method. After all of the visitors are visited, the after() method is called on each visitor. This is the place in which you should handle things like additionalProperties with custom locations (i.e., this is how it is handled in the JSON visitor).

Summary

Methods
Properties
Constants
__construct()
__invoke()
No public properties found
No constants found
visit()
handleErrorResponses()
No protected properties found
N/A
triggerBeforeVisitor()
visitOuterObject()
visitOuterArray()
$responseLocations
$description
$process
N/A

Properties

$responseLocations

$responseLocations : \GuzzleHttp\Command\Guzzle\ResponseLocation\ResponseLocationInterface[]

Type

ResponseLocationInterface[]

$description

$description : \GuzzleHttp\Command\Guzzle\DescriptionInterface

Type

DescriptionInterface

$process

$process : bool

Type

bool

Methods

__construct()

__construct(\GuzzleHttp\Command\Guzzle\DescriptionInterface  $description, bool  $process, \GuzzleHttp\Command\Guzzle\ResponseLocation\ResponseLocationInterface[]  $responseLocations = []) : mixed

Parameters

\GuzzleHttp\Command\Guzzle\DescriptionInterface $description
bool $process
\GuzzleHttp\Command\Guzzle\ResponseLocation\ResponseLocationInterface[] $responseLocations

Extra response locations

Returns

mixed —

__invoke()

__invoke(\Psr\Http\Message\ResponseInterface  $response, \Psr\Http\Message\RequestInterface|null  $request, \GuzzleHttp\Command\CommandInterface  $command) : \GuzzleHttp\Command\Result|\GuzzleHttp\Command\ResultInterface|void|\Psr\Http\Message\ResponseInterface

Deserialize the response into the specified result representation

Parameters

\Psr\Http\Message\ResponseInterface $response
\Psr\Http\Message\RequestInterface|null $request
\GuzzleHttp\Command\CommandInterface $command

Returns

\GuzzleHttp\Command\Result|\GuzzleHttp\Command\ResultInterface|void|\Psr\Http\Message\ResponseInterface —

visit()

visit(\GuzzleHttp\Command\Guzzle\Parameter  $model, \Psr\Http\Message\ResponseInterface  $response) : \GuzzleHttp\Command\Result|\GuzzleHttp\Command\ResultInterface|void

Handles visit() and after() methods of the Response locations

Parameters

\GuzzleHttp\Command\Guzzle\Parameter $model
\Psr\Http\Message\ResponseInterface $response

Returns

\GuzzleHttp\Command\Result|\GuzzleHttp\Command\ResultInterface|void —

handleErrorResponses()

handleErrorResponses(\Psr\Http\Message\ResponseInterface  $response, \Psr\Http\Message\RequestInterface  $request, \GuzzleHttp\Command\CommandInterface  $command, \GuzzleHttp\Command\Guzzle\Operation  $operation) : mixed

Reads the "errorResponses" from commands, and trigger appropriate exceptions

In order for the exception to be properly triggered, all your exceptions must be instance of "GuzzleHttp\Command\Exception\CommandException". If that's not the case, your exceptions will be wrapped around a CommandException

Parameters

\Psr\Http\Message\ResponseInterface $response
\Psr\Http\Message\RequestInterface $request
\GuzzleHttp\Command\CommandInterface $command
\GuzzleHttp\Command\Guzzle\Operation $operation

Returns

mixed —

triggerBeforeVisitor()

triggerBeforeVisitor(string  $location, \GuzzleHttp\Command\Guzzle\Parameter  $model, \GuzzleHttp\Command\ResultInterface  $result, \Psr\Http\Message\ResponseInterface  $response, array  $context) : \GuzzleHttp\Command\ResultInterface

Handles the before() method of Response locations

Parameters

string $location
\GuzzleHttp\Command\Guzzle\Parameter $model
\GuzzleHttp\Command\ResultInterface $result
\Psr\Http\Message\ResponseInterface $response
array $context

Returns

\GuzzleHttp\Command\ResultInterface —

visitOuterObject()

visitOuterObject(\GuzzleHttp\Command\Guzzle\Parameter  $model, \GuzzleHttp\Command\ResultInterface  $result, \Psr\Http\Message\ResponseInterface  $response, array  $context) : \GuzzleHttp\Command\ResultInterface

Visits the outer object

Parameters

\GuzzleHttp\Command\Guzzle\Parameter $model
\GuzzleHttp\Command\ResultInterface $result
\Psr\Http\Message\ResponseInterface $response
array $context

Returns

\GuzzleHttp\Command\ResultInterface —

visitOuterArray()

visitOuterArray(\GuzzleHttp\Command\Guzzle\Parameter  $model, \GuzzleHttp\Command\ResultInterface  $result, \Psr\Http\Message\ResponseInterface  $response, array  $context) : \GuzzleHttp\Command\ResultInterface|void

Visits the outer array

Parameters

\GuzzleHttp\Command\Guzzle\Parameter $model
\GuzzleHttp\Command\ResultInterface $result
\Psr\Http\Message\ResponseInterface $response
array $context

Returns

\GuzzleHttp\Command\ResultInterface|void —