HandlerHelperTrait
trait HandlerHelperTrait
Handler helper trait.
Methods
bool
returnAs(string $function, array $mimes, string $partial)
Checks if we meet the requirements to return as a specific type.
bool
returnAsJson()
Should we return the error as JSON?
bool
returnAsXml()
Should we return the error as XML?
int
sendResponse(Response $response, Throwable $exception)
Sends response and adds any aditional headers.
Details
at line 35
protected bool
returnAs(string $function, array $mimes, string $partial)
Checks if we meet the requirements to return as a specific type.
at line 62
protected bool
returnAsJson()
Should we return the error as JSON?
at line 72
protected bool
returnAsXml()
Should we return the error as XML?
at line 83
protected int
getStatusCode(Throwable $exception)
Returns the status code that we should send.