interface ErrorHandlerInterface

The interface implemented by Asplode error handlers.

Methods

setFallbackHandler( callable|null $fallbackHandler = null)

Set an error handler to use as a fallback for errors that are not handled by Asplode.

callable
fallbackHandler()

Get the error handler used as a fallback for errors that are not handled by Asplode.

install()

Installs this error handler.

uninstall()

Uninstalls this error handler.

boolean
isInstalled()

Returns true if this error handler is the top-most handler on the stack.

boolean
handle( integer $severity, string $message, string $filename, integer $lineno)

Handles a PHP error.

Details

at line 33
setFallbackHandler( callable|null $fallbackHandler = null)

Set an error handler to use as a fallback for errors that are not handled by Asplode.

Errors not handled by Asplode include deprecation messages, and '@' suppressed errors.

Parameters

callable|null $fallbackHandler The fallback handler to use, or null to use the default PHP handler.

at line 41
callable fallbackHandler()

Get the error handler used as a fallback for errors that are not handled by Asplode.

Return Value

callable The fallback error handler.

at line 49
install()

Installs this error handler.

Exceptions

AlreadyInstalledException If this error handler is already the top-most handler on the stack.
ErrorHandlingConfigurationException If the error reporting level is incorrectly configured.

at line 56
uninstall()

Uninstalls this error handler.

Exceptions

NotInstalledException If this error handler is not the top-most handler on the stack.

at line 63
boolean isInstalled()

Returns true if this error handler is the top-most handler on the stack.

Return Value

boolean True if this error handler is the top-most handler on the stack.

at line 76
boolean handle( integer $severity, string $message, string $filename, integer $lineno)

Handles a PHP error.

Parameters

integer $severity The severity of the error.
string $message The error message.
string $filename The filename in which the error was raised.
integer $lineno The line number in which the error was raised.

Return Value

boolean False if the error is a deprecation message, or '@' suppression is in use.

Exceptions

NonFatalErrorExceptionInterface Representing the error, unless the error is a deprecation message, or '@' suppression is in use.