DevelopmentHandler
class DevelopmentHandler extends Handler implements HandlerInterface
Development handler.
Traits
Basic content negotiation.
Properties
protected Request | $request | Request instance. | |
protected Response | $response | Response instance. | |
protected Run | $whoops | Whoops. | |
protected Application | $app | Application instance. |
Methods
bool
expectsType(array $mimeTypes, string|null $suffix = null)
Does the client expect the provided mime type?
bool
respondWithType(array $mimeTypes, string|null $suffix = null)
Should we respond with the provided mime type?
sendResponse(Response $response, Throwable $exception)
Sends response and adds any aditional headers.
from Handler
HandlerInterface
getWhoopsHandler()
Returns a Whoops handler.
configureWhoops()
Configure Whoops.
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 65
__construct(Run $whoops, Request $request, Response $response, Application $app)
Constructor.
at line 83
protected HandlerInterface
getWhoopsHandler()
Returns a Whoops handler.
at line 122
protected
configureWhoops()
Configure Whoops.
at line 134
mixed
handle(Throwable $exception)
Handles the exception.