You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The constructor accepts a Whoops\Run instance but creates one automatically if it's not provided. Optionally, you can provide a Psr\Http\Message\ResponseFactoryInterface as the second argument to create the response. If it's not defined, Middleware\Utils\Factory will be used to detect it automatically.
$whoops = newWhoops\Run();
$responseFactory = newMyOwnResponseFactory();
//Create a Run instance automatically$middleware = newMiddlewares\Whoops();
//Pass your own Run instance$middleware = newMiddlewares\Whoops($whoops);
//Pass a Run instance and ResponseFactory$middleware = newMiddlewares\Whoops($whoops, $responseFactory);
catchErrors
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 ->catchErrors(false);
//Do not catch errors$middleware = (newMiddlewares\Whoops())->catchErrors(false);
handlerContainer
This option allows to define a custom PSR-11 container used to create the intance of Whoops\Handler\HandlerInterface based in the Accept header in the request.
Please see CHANGELOG for more information about recent changes and CONTRIBUTING for contributing details.
The MIT License (MIT). Please see LICENSE for more information.