\Guzzle\Service\Command\LocationVisitor\ResponseJsonVisitor

Location visitor used to marshal JSON response data into a formatted array.

Allows top level JSON parameters to be inserted into the result of a command. The top level attributes are grabbed from the response's JSON data using the name value by default. Filters can be applied to parameters as they are traversed. This allows data to be normalized before returning it to users (for example converting timestamps to DateTime objects).

Summary

Methods
Properties
Constants
before()
after()
visit()
No public properties found
No constants found
recursiveProcess()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

before()

before(\Guzzle\Service\Command\CommandInterface  $command, array  $result) 

Called before visiting all parameters. This can be used for seeding the result of a command with default data (e.g. populating with JSON data in the response then adding to the parsed data).

Parameters

\Guzzle\Service\Command\CommandInterface $command

Command being visited

array $result

Result value to update if needed (e.g. parsing XML or JSON)

visit()

visit(\Guzzle\Service\Command\CommandInterface  $command, \Guzzle\Http\Message\Response  $response, \Guzzle\Service\Description\Parameter  $param, mixed  $value, mixed  $context = null) 

Called once for each parameter being visited that matches the location type

Parameters

\Guzzle\Service\Command\CommandInterface $command

Command being visited

\Guzzle\Http\Message\Response $response

Response being visited

\Guzzle\Service\Description\Parameter $param

Parameter being visited

mixed $value

Result associative array value being updated by reference

mixed $context

Parsing context

recursiveProcess()

recursiveProcess(\Guzzle\Service\Description\Parameter  $param, mixed  $value) 

Recursively process a parameter while applying filters

Parameters

\Guzzle\Service\Description\Parameter $param

API parameter being validated

mixed $value

Value to validate and process. The value may change during this process.