Handler
abstract class Handler
Base handler.
Traits
Basic content negotiation.
Properties
Request | $request | from ContentNegotiationTrait | |
Response | $response | from ContentNegotiationTrait |
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?
int
sendResponse(Response $response, Throwable $exception)
Sends response and adds any aditional headers.
Details
in ContentNegotiationTrait at line 30
protected bool
expectsType(array $mimeTypes, string|null $suffix = null)
Does the client expect the provided mime type?
in ContentNegotiationTrait at line 47
protected bool
expectsJson()
Does the client expect JSON?
in ContentNegotiationTrait at line 57
protected bool
expectsXml()
Does the client expect XML?
in ContentNegotiationTrait at line 69
protected bool
respondWithType(array $mimeTypes, string|null $suffix = null)
Should we respond with the provided mime type?
in ContentNegotiationTrait at line 86
protected bool
respondWithJson()
Should we respond with JSON?
in ContentNegotiationTrait at line 96
protected bool
respondWithXml()
Should we respond with XML?
at line 33
protected int
getStatusCode(Throwable $exception)
Returns the status code that we should send.