ResponseVisitorInterface
in
Location visitor used to parse values out of a response into an associative array
Table of Contents
Methods
- after() : mixed
- Called after visiting all parameters
- before() : mixed
- 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).
- visit() : mixed
- Called once for each parameter being visited that matches the location type
Methods
after()
Called after visiting all parameters
public
after(CommandInterface $command) : mixed
Parameters
- $command : CommandInterface
-
Command being visited
before()
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).
public
before(CommandInterface $command, array<string|int, mixed> &$result) : mixed
Parameters
- $command : CommandInterface
-
Command being visited
- $result : array<string|int, mixed>
-
Result value to update if needed (e.g. parsing XML or JSON)
visit()
Called once for each parameter being visited that matches the location type
public
visit(CommandInterface $command, Response $response, Parameter $param, mixed &$value[, mixed $context = null ]) : mixed
Parameters
- $command : CommandInterface
-
Command being visited
- $response : Response
-
Response being visited
- $param : Parameter
-
Parameter being visited
- $value : mixed
-
Result associative array value being updated by reference
- $context : mixed = null
-
Parsing context