ProductionHandler
class ProductionHandler extends Handler implements HandlerInterface
Production handler.
Traits
Properties
protected Request | $request | Request instance. | |
protected Response | $response | Response instance. | |
protected ViewFactory|null | $view | View factory instance. |
Methods
Does the client expect the provided mime type?
Should we respond with the provided mime type?
Sends response and adds any aditional headers.
Details
in ContentNegotiationTrait at line 28
protected bool
expectsType(array $mimeTypes, string|null $suffix = null)
Does the client expect the provided mime type?
in ContentNegotiationTrait at line 45
protected bool
expectsJson()
Does the client expect JSON?
in ContentNegotiationTrait at line 55
protected bool
expectsXml()
Does the client expect XML?
in ContentNegotiationTrait at line 67
protected bool
respondWithType(array $mimeTypes, string|null $suffix = null)
Should we respond with the provided mime type?
in ContentNegotiationTrait at line 84
protected bool
respondWithJson()
Should we respond with JSON?
in ContentNegotiationTrait at line 94
protected bool
respondWithXml()
Should we respond with XML?
in Handler at line 31
protected int
getStatusCode(Throwable $exception)
Returns the status code that we should send.
in Handler at line 42
protected
sendResponse(Response $response, Throwable $exception)
Sends response and adds any aditional headers.
at line 54
__construct(Request $request, Response $response, ViewFactory|null $view = null)
Constructor.
at line 74
protected array
getStatusCodeAndMessage(Throwable $exception)
Returns status code and message.
at line 95
protected string
getExceptionAsJson(Throwable $exception)
Return a JSON representation of the exception.
at line 106
protected string
getExceptionAsXml(Throwable $exception)
Return a XML representation of the exception.
at line 125
protected string
getExceptionAsRenderedView(Throwable $exception)
Returns a rendered error view.
at line 155
protected string
getExceptionAsPlainText(Throwable $exception)
Returns a plain text representation of the error.
at line 168
protected string
getBody(Throwable $exception)
Returns a response body.
at line 199
mixed
handle(Throwable $exception)
Handles the exception.