Documentation

BodyVisitor extends AbstractResponseVisitor
in package

Visitor used to add the body of a response to a particular key

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

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


        
On this page

Search results