class ErrorHandler implements ErrorHandlerInterface

The standard Asplode error handler.

Methods

__construct( HandlerStackInterface $stack = null, Isolator $isolator = null)

Construct a new error handler.

stack()

Get the error handler stack.

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.

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

Handles a PHP error.

Details

at line 34
__construct( HandlerStackInterface $stack = null, Isolator $isolator = null)

Construct a new error handler.

Parameters

HandlerStackInterface $stack The error handler stack to use.
Isolator $isolator The isolator to use.

at line 53
HandlerStackInterface stack()

Get the error handler stack.

Return Value

HandlerStackInterface The error handler stack.

at line 67
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 84
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 95
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 113
uninstall()

Uninstalls this error handler.

Exceptions

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

at line 131
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 147
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.

at line 173
boolean __invoke( 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.