Leaf PHP

RunInterface

Table of Contents

Constants

ERROR_HANDLER  = "handleError"
EXCEPTION_HANDLER  = "handleException"
SHUTDOWN_HANDLER  = "handleShutdown"

Methods

allowQuit()  : bool
Should Whoops allow Handlers to force the script to quit?
clearHandlers()  : Run
Clears all handlers in the handlerStack, including the default PrettyPage handler.
getHandlers()  : array<string|int, mixed>
Returns an array with all handlers, in the order they were added to the stack.
handleError()  : bool
Converts generic PHP errors to \ErrorException instances, before passing them off to be handled.
handleException()  : string
Handles an exception, ultimately generating a Whoops error page.
handleShutdown()  : mixed
Special case to deal with Fatal errors and the like.
popHandler()  : null|HandlerInterface
Removes the last handler in the stack and returns it.
pushHandler()  : Run
Pushes a handler to the end of the stack
register()  : Run
Registers this instance as an error handler.
sendExitCode()  : int
Should Whoops exit with a specific code on the CLI if possible? Whoops will exit with 1 by default, but you can specify something else.
sendHttpCode()  : int|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.
silenceErrorsInPaths()  : Run
Silence particular errors in particular files
unregister()  : Run
Unregisters all handlers registered by this Whoops\Run instance
writeToOutput()  : bool
Should Whoops push output directly to the client? If this is false, output will be returned by handleException

Constants

ERROR_HANDLER

public mixed ERROR_HANDLER = "handleError"

EXCEPTION_HANDLER

public mixed EXCEPTION_HANDLER = "handleException"

SHUTDOWN_HANDLER

public mixed SHUTDOWN_HANDLER = "handleShutdown"

Methods

allowQuit()

Should Whoops allow Handlers to force the script to quit?

public allowQuit([bool|int $exit = null ]) : bool
Parameters
$exit : bool|int = null
Return values
bool

clearHandlers()

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

public clearHandlers() : Run
Return values
Run

getHandlers()

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

public getHandlers() : array<string|int, mixed>
Return values
array<string|int, mixed>

handleError()

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

public handleError(int $level, string $message[, string $file = null ][, int $line = null ]) : bool

This method MUST be compatible with set_error_handler.

Parameters
$level : int
$message : string
$file : string = null
$line : int = null
Tags
throws
ErrorException
Return values
bool

handleException()

Handles an exception, ultimately generating a Whoops error page.

public handleException(Throwable $exception) : string
Parameters
$exception : Throwable
Return values
string

Output generated by handlers

handleShutdown()

Special case to deal with Fatal errors and the like.

public handleShutdown() : mixed

pushHandler()

Pushes a handler to the end of the stack

public pushHandler(callable|HandlerInterface $handler) : Run
Parameters
$handler : callable|HandlerInterface
Tags
throws
InvalidArgumentException

If argument is not callable or instance of HandlerInterface

Return values
Run

register()

Registers this instance as an error handler.

public register() : Run
Return values
Run

sendExitCode()

Should Whoops exit with a specific code on the CLI if possible? Whoops will exit with 1 by default, but you can specify something else.

public sendExitCode([int $code = null ]) : int
Parameters
$code : int = null
Return values
int

sendHttpCode()

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.

public sendHttpCode([bool|int $code = null ]) : int|false
Parameters
$code : bool|int = null
Return values
int|false

silenceErrorsInPaths()

Silence particular errors in particular files

public silenceErrorsInPaths(array<string|int, mixed>|string $patterns[, int $levels = 10240 ]) : Run
Parameters
$patterns : array<string|int, mixed>|string

List or a single regex pattern to match

$levels : int = 10240

Defaults to E_STRICT | E_DEPRECATED

Return values
Run

unregister()

Unregisters all handlers registered by this Whoops\Run instance

public unregister() : Run
Return values
Run

writeToOutput()

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

public writeToOutput([bool|int $send = null ]) : bool
Parameters
$send : bool|int = null
Return values
bool

        
On this page

Search results