class ErrorHandlerStack extends AbstractHandlerStack

Manages the PHP error handler stack.

Methods

__construct( Isolator $isolator = null)

Construct a new handler stack.

callable|null
handler()

Gets the current handler without removing it from the stack.

array<callable>
handlerStack()

Gets the current handler stack without changing the stack.

pushAll( array $handlers)

Pushes multiple handlers on to the stack.

array<callable>
clear()

Removes all handlers from the stack.

restore( array $handlers)

Restores a stack of handlers.

mixed
executeWith( callable $callable, callable|null $handler = null)

Temporarily bypass the current handler stack and execute a callable with the supplied handler.

push( callable $handler)

Pushes a handler on to the stack.

callable|null
pop()

Pops a handler off the stack.

Details

in AbstractHandlerStack at line 27
__construct( Isolator $isolator = null)

Construct a new handler stack.

Parameters

Isolator $isolator The isolator to use.

in AbstractHandlerStack at line 37
callable|null handler()

Gets the current handler without removing it from the stack.

Return Value

callable|null The current handler.

in AbstractHandlerStack at line 53
array<callable> handlerStack()

Gets the current handler stack without changing the stack.

Return Value

array<callable> The current handler stack.

in AbstractHandlerStack at line 65
pushAll( array $handlers)

Pushes multiple handlers on to the stack.

Parameters

array $handlers The handlers to push on to the stack.

in AbstractHandlerStack at line 75
array<callable> clear()

Removes all handlers from the stack.

Return Value

array<callable> The removed handlers.

in AbstractHandlerStack at line 91
restore( array $handlers)

Restores a stack of handlers.

Parameters

array $handlers The handlers to restore.

in AbstractHandlerStack at line 110
mixed executeWith( callable $callable, callable|null $handler = null)

Temporarily bypass the current handler stack and execute a callable with the supplied handler.

This method is useful for executing PHP code that relies upon handling techniques that are incompatible with Asplode

Parameters

callable $callable The callable to invoke.
callable|null $handler The handler to use.

Return Value

mixed The result of the callable's invocation.

Exceptions

Exception If the callable throws an exception.

at line 26
push( callable $handler)

Pushes a handler on to the stack.

Parameters

callable $handler The handler to push on to the stack.

at line 36
callable|null pop()

Pops a handler off the stack.

Return Value

callable|null The handler that was removed from the stack, or null if the stack is empty.