Middleware to use Whoops as error handler.
This package is installable and autoloadable via Composer as middlewares/whoops.
composer require middlewares/whoops
$dispatcher = new Dispatcher([ new Middlewares\Whoops() ]); $response = $dispatcher->dispatch(new ServerRequest());
__construct(Whoops\Run $whoops = null, Whoops\Util\SystemFacade $system = null)
Allows to provide a custom
Whoops\Run instance. If it's not defined, creates an instance automatically. You can provide also the
SystemFacade used by the
Run instance, in order to implement a special behaviour with fatal errors.
To catch not only throwable exceptions, but also php errors. This makes whoops to be registered temporary in order to capture the errors using
set_error_handler. It's enabled by default so, to disable it you have to use
To define a custom PSR-11 container used to create the intance of
Whoops\Handler\HandlerInterface based in the
Accept header in the request.
A PSR-17 factory to create the error response.
The MIT License (MIT). Please see LICENSE for more information.