XmlResponseHandler
extends Handler
in package
Catches an exception and converts it to an XML response. Additionally can also return exception frames for consumption by an API.
Table of Contents
Constants
- DONE = 0x10
- LAST_HANDLER = 0x20
- The Handler has handled the Throwable in some way, and wishes to skip any other Handler.
- QUIT = 0x30
- The Handler has handled the Throwable in some way, and wishes to quit/stop execution
Properties
- $exception : Throwable
- $inspector : Inspector
- $returnFrames : bool
- $run : RunInterface
Methods
- addTraceToOutput() : bool|static
- contentType() : string
- handle() : int
- setException() : void
- setInspector() : void
- setRun() : void
- getException() : Throwable
- getInspector() : Inspector
- getRun() : RunInterface
- addDataToNode() : SimpleXMLElement
- toXml() : string
- The main function for converting to an XML document.
Constants
DONE
public
mixed
DONE
= 0x10
LAST_HANDLER
The Handler has handled the Throwable in some way, and wishes to skip any other Handler.
public
mixed
LAST_HANDLER
= 0x20
Execution will continue.
QUIT
The Handler has handled the Throwable in some way, and wishes to quit/stop execution
public
mixed
QUIT
= 0x30
Properties
$exception
private
Throwable
$exception
$inspector
private
Inspector
$inspector
$returnFrames
private
bool
$returnFrames
= false
$run
private
RunInterface
$run
Methods
addTraceToOutput()
public
addTraceToOutput([bool|null $returnFrames = null ]) : bool|static
Parameters
- $returnFrames : bool|null = null
Return values
bool|staticcontentType()
public
contentType() : string
Return values
stringhandle()
public
handle() : int
Return values
intsetException()
public
setException(Throwable $exception) : void
Parameters
- $exception : Throwable
setInspector()
public
setInspector(Inspector $inspector) : void
Parameters
- $inspector : Inspector
setRun()
public
setRun(RunInterface $run) : void
Parameters
- $run : RunInterface
getException()
protected
getException() : Throwable
Return values
ThrowablegetInspector()
protected
getInspector() : Inspector
Return values
InspectorgetRun()
protected
getRun() : RunInterface
Return values
RunInterfaceaddDataToNode()
private
static addDataToNode(SimpleXMLElement $node, array<string|int, mixed>|Traversable $data) : SimpleXMLElement
Parameters
- $node : SimpleXMLElement
-
Node to append data to, will be modified in place
- $data : array<string|int, mixed>|Traversable
Return values
SimpleXMLElement —The modified node, for chaining
toXml()
The main function for converting to an XML document.
private
static toXml(array<string|int, mixed>|Traversable $data) : string
Parameters
- $data : array<string|int, mixed>|Traversable
Return values
string —XML