HeaderVisitor
extends AbstractResponseVisitor
in package
Location visitor used to add a particular header of a response to a key in the result
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
- processPrefixedHeaders() : mixed
- Process a prefixed header array
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
processPrefixedHeaders()
Process a prefixed header array
protected
processPrefixedHeaders(Response $response, Parameter $param, array<string|int, mixed> &$value) : mixed