Method | Description | |
---|---|---|
__construct ( callable | string | null $handler = null ) | Constructor. | |
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface | Execute the middleware. | |
catchExceptions ( boolean $catch = true ) : self | Configure the catchExceptions. | |
getException ( Psr\Http\Message\ServerRequestInterface $request ) : Exception | null | Returns the exception throwed. | |
statusCode ( callable $statusCodeValidator ) : self | Configure the status code validator. |
Method | Description | |
---|---|---|
defaultHandler ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response ) : string | Default handler. | |
errorHtml ( integer $statusCode, string $message ) : string | Print the error as html. | |
errorImage ( integer $statusCode, string $message, string $output ) : string | Print the error as image. | |
errorJson ( integer $statusCode, string $message ) : string | Print the error as json. | |
errorSvg ( integer $statusCode, string $message ) : string | Print the error as svg image. | |
errorText ( integer $statusCode, string $message ) : string | Print the error as plain text. | |
errorXml ( integer $statusCode, string $message ) : string | Print the error as xml. | |
isError ( integer $statusCode ) : boolean | Check whether the status code represents an error or not. |
public __invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface | ||
$request | Psr\Http\Message\ServerRequestInterface | |
$response | Psr\Http\Message\ResponseInterface | |
$next | callable | |
return | Psr\Http\Message\ResponseInterface |
public catchExceptions ( boolean $catch = true ) : self | ||
$catch | boolean | |
return | self |
public static getException ( Psr\Http\Message\ServerRequestInterface $request ) : Exception | null | ||
$request | Psr\Http\Message\ServerRequestInterface | |
return | Exception | null |
public statusCode ( callable $statusCodeValidator ) : self | ||
$statusCodeValidator | callable | |
return | self |