Handler
abstract class Handler
Base handler.
Traits
Basic content negotiation.
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 27
protected bool
expectsType(array $mimeTypes, string|null $suffix = null)
Does the client expect the provided mime type?
in ContentNegotiationTrait at line 44
protected bool
expectsJson()
Does the client expect JSON?
in ContentNegotiationTrait at line 54
protected bool
expectsXml()
Does the client expect XML?
in ContentNegotiationTrait at line 66
protected bool
respondWithType(array $mimeTypes, string|null $suffix = null)
Should we respond with the provided mime type?
in ContentNegotiationTrait at line 83
protected bool
respondWithJson()
Should we respond with JSON?
in ContentNegotiationTrait at line 93
protected bool
respondWithXml()
Should we respond with XML?
at line 33
protected int
getStatusCode(Throwable $exception)
Returns the status code that we should send.