Leaf PHP

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

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

Methods

addTraceToOutput()

public addTraceToOutput([bool|null $returnFrames = null ]) : bool|static
Parameters
$returnFrames : bool|null = null
Return values
bool|static

setException()

public setException(Throwable $exception) : void
Parameters
$exception : Throwable

getException()

protected getException() : Throwable
Return values
Throwable

addDataToNode()

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


        
On this page

Search results