\GuzzleHttp\Command\Guzzle\ResponseLocationJsonLocation

Extracts elements from a JSON document.

Summary

Methods
Properties
Constants
__construct()
before()
after()
visit()
No public properties found
No constants found
No protected methods found
$locationName
N/A
recurse()
$json
N/A

Properties

$locationName

$locationName : string

Type

string

$json

$json : array

Type

array — The JSON document being visited

Methods

__construct()

__construct(string  $locationName = 'json') : mixed

Set the name of the location

Parameters

string $locationName

Returns

mixed —

before()

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

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

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

Returns

\GuzzleHttp\Command\ResultInterface —

after()

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

Called after visiting all parameters

Parameters

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

Returns

\GuzzleHttp\Command\ResultInterface —

visit()

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

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

Parameters

\GuzzleHttp\Command\ResultInterface $result
\Psr\Http\Message\ResponseInterface $response
\GuzzleHttp\Command\Guzzle\Parameter $param

Returns

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

recurse()

recurse(\GuzzleHttp\Command\Guzzle\Parameter  $param, mixed  $value) : mixed|null

Recursively process a parameter while applying filters

Parameters

\GuzzleHttp\Command\Guzzle\Parameter $param

API parameter being validated

mixed $value

Value to process.

Returns

mixed|null —