XmlVisitor
extends AbstractResponseVisitor
in package
Location visitor used to marshal XML response data into a formatted 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
- processArray() : mixed
- Process an array
- processObject() : mixed
- Process an object
- processXmlAttribute() : mixed
- Process an XML attribute property
- recursiveProcess() : mixed
- Recursively process a parameter while applying filters
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
processArray()
Process an array
protected
processArray(Parameter $param, mixed &$value) : mixed
Parameters
- $param : Parameter
-
API parameter being parsed
- $value : mixed
-
Value to process
processObject()
Process an object
protected
processObject(Parameter $param, mixed &$value) : mixed
Parameters
- $param : Parameter
-
API parameter being parsed
- $value : mixed
-
Value to process
processXmlAttribute()
Process an XML attribute property
protected
processXmlAttribute(Parameter $property, array<string|int, mixed> &$value) : mixed
Parameters
- $property : Parameter
-
Property to process
- $value : array<string|int, mixed>
-
Value to process and update
recursiveProcess()
Recursively process a parameter while applying filters
protected
recursiveProcess(Parameter $param, mixed &$value) : mixed
Parameters
- $param : Parameter
-
API parameter being processed
- $value : mixed
-
Value to validate and process. The value may change during this process.