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 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?
at line 31
protected int
getStatusCode(Throwable $exception)
Returns the status code that we should send.