interface HandlerStackInterface

The interface implemented by handler stacks.

Methods

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.

push( callable $handler)

Pushes a handler on to the stack.

pushAll( array $handlers)

Pushes multiple handlers on to the stack.

callable|null
pop()

Pops a handler off 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.

Details

at line 24
callable|null handler()

Gets the current handler without removing it from the stack.

Return Value

callable|null The current handler.

at line 31
array<callable> handlerStack()

Gets the current handler stack without changing the stack.

Return Value

array<callable> The current handler stack.

at line 38
push( callable $handler)

Pushes a handler on to the stack.

Parameters

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

at line 45
pushAll( array $handlers)

Pushes multiple handlers on to the stack.

Parameters

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

at line 52
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.

at line 59
array<callable> clear()

Removes all handlers from the stack.

Return Value

array<callable> The removed handlers.

at line 66
restore( array $handlers)

Restores a stack of handlers.

Parameters

array $handlers The handlers to restore.

at line 81
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.