PHP Class Psr7Middlewares\Middleware\Whoops

Show file Open project: oscarotero/psr7-middlewares

Public Methods

Method Description
__construct ( Whoops\Run $whoops = null ) Set the whoops instance.
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface Execute the middleware.
catchErrors ( boolean $catchErrors = true ) : self Whether catch errors or not.

Private Methods

Method Description
getWhoopsInstance ( Psr\Http\Message\ServerRequestInterface $request ) : Whoops\Run Returns the whoops instance or create one.

Method Details

__construct() public method

Set the whoops instance.
public __construct ( Whoops\Run $whoops = null )
$whoops Whoops\Run

__invoke() public method

Execute the middleware.
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

catchErrors() public method

Whether catch errors or not.
public catchErrors ( boolean $catchErrors = true ) : self
$catchErrors boolean
return self