Constants

EXCEPTION_HANDLER

EXCEPTION_HANDLER = "handleException"

ERROR_HANDLER

ERROR_HANDLER = "handleError"

SHUTDOWN_HANDLER

SHUTDOWN_HANDLER = "handleShutdown"

Methods

pushHandler()

pushHandler(Callable|\Whoops\Handler\HandlerInterface  $handler) : \Whoops\Run

Pushes a handler to the end of the stack

Parameters

Callable|\Whoops\Handler\HandlerInterface $handler

Throws

\InvalidArgumentException

If argument is not callable or instance of HandlerInterface

Returns

\Whoops\Run

popHandler()

popHandler() : null|\Whoops\Handler\HandlerInterface

Removes the last handler in the stack and returns it.

Returns null if there"s nothing else to pop.

Returns

null|\Whoops\Handler\HandlerInterface

getHandlers()

getHandlers() : array

Returns an array with all handlers, in the order they were added to the stack.

Returns

array

clearHandlers()

clearHandlers() : \Whoops\Run

Clears all handlers in the handlerStack, including the default PrettyPage handler.

Returns

\Whoops\Run

register()

register() : \Whoops\Run

Registers this instance as an error handler.

Returns

\Whoops\Run

unregister()

unregister() : \Whoops\Run

Unregisters all handlers registered by this Whoops\Run instance

Returns

\Whoops\Run

allowQuit()

allowQuit(boolean|integer  $exit = null) : boolean

Should Whoops allow Handlers to force the script to quit?

Parameters

boolean|integer $exit

Returns

boolean

silenceErrorsInPaths()

silenceErrorsInPaths(array|string  $patterns, integer  $levels = 10240) : \Whoops\Run

Silence particular errors in particular files

Parameters

array|string $patterns

List or a single regex pattern to match

integer $levels

Defaults to E_STRICT | E_DEPRECATED

Returns

\Whoops\Run

sendHttpCode()

sendHttpCode(boolean|integer  $code = null) : integer|false

Should Whoops send HTTP error code to the browser if possible? Whoops will by default send HTTP code 500, but you may wish to use 502, 503, or another 5xx family code.

Parameters

boolean|integer $code

Returns

integer|false

writeToOutput()

writeToOutput(boolean|integer  $send = null) : boolean

Should Whoops push output directly to the client? If this is false, output will be returned by handleException

Parameters

boolean|integer $send

Returns

boolean

handleException()

handleException(\Throwable  $exception) : string

Handles an exception, ultimately generating a Whoops error page.

Parameters

\Throwable $exception

Returns

string —

Output generated by handlers

handleError()

handleError(integer  $level, string  $message, string  $file = null, integer  $line = null) : boolean

Converts generic PHP errors to \ErrorException instances, before passing them off to be handled.

This method MUST be compatible with set_error_handler.

Parameters

integer $level
string $message
string $file
integer $line

Throws

\Whoops\Exception\ErrorException

Returns

boolean

handleShutdown()

handleShutdown() 

Special case to deal with Fatal errors and the like.