RestJsonErrorParser
extends AbstractErrorParser
in package
Uses
JsonParserTrait
Parses JSON-REST errors.
Table of Contents
- $api : Service
- $parser : mixed
- __construct() : mixed
- __invoke() : mixed
- extractHeader() : mixed
- Extract a single header from the response into the result.
- extractHeaders() : mixed
- Extract a map of headers with an optional prefix from the response.
- extractPayload() : mixed
- extractStatus() : mixed
- Places the status code of the response into the result array.
- parseXml() : SimpleXMLElement
- payload() : mixed
- populateShape() : mixed
- genericHandler() : mixed
- parseJson() : array<string|int, mixed>
Properties
$api
protected
Service
$api
$parser
private
mixed
$parser
Methods
__construct()
public
__construct([Service $api = null ][, JsonParser $parser = null ]) : mixed
Parameters
- $api : Service = null
- $parser : JsonParser = null
Return values
mixed —__invoke()
public
__invoke(ResponseInterface $response[, CommandInterface $command = null ]) : mixed
Parameters
- $response : ResponseInterface
- $command : CommandInterface = null
Return values
mixed —extractHeader()
Extract a single header from the response into the result.
protected
extractHeader(mixed $name, Shape $shape, ResponseInterface $response, mixed &$result) : mixed
Parameters
- $name : mixed
- $shape : Shape
- $response : ResponseInterface
- $result : mixed
Return values
mixed —extractHeaders()
Extract a map of headers with an optional prefix from the response.
protected
extractHeaders(mixed $name, Shape $shape, ResponseInterface $response, mixed &$result) : mixed
Parameters
- $name : mixed
- $shape : Shape
- $response : ResponseInterface
- $result : mixed
Return values
mixed —extractPayload()
protected
extractPayload(StructureShape $member, ResponseInterface $response) : mixed
Parameters
- $member : StructureShape
- $response : ResponseInterface
Return values
mixed —extractStatus()
Places the status code of the response into the result array.
protected
extractStatus(mixed $name, ResponseInterface $response, array<string|int, mixed> &$result) : mixed
Parameters
- $name : mixed
- $response : ResponseInterface
- $result : array<string|int, mixed>
Return values
mixed —parseXml()
protected
parseXml(string $xml, mixed $response) : SimpleXMLElement
Parameters
- $xml : string
- $response : mixed
Tags
Return values
SimpleXMLElement —payload()
protected
abstract payload(ResponseInterface $response, StructureShape $member) : mixed
Parameters
- $response : ResponseInterface
- $member : StructureShape
Return values
mixed —populateShape()
protected
populateShape(array<string|int, mixed> &$data, ResponseInterface $response[, CommandInterface $command = null ]) : mixed
Parameters
- $data : array<string|int, mixed>
- $response : ResponseInterface
- $command : CommandInterface = null
Return values
mixed —genericHandler()
private
genericHandler(ResponseInterface $response) : mixed
Parameters
- $response : ResponseInterface
Return values
mixed —parseJson()
private
parseJson(string $json, mixed $response) : array<string|int, mixed>
Parameters
- $json : string
- $response : mixed