Fr3nch13/CakePHP Utilities

EmitterStack extends SplStack
in package
implements EmitterInterface

Provides an EmitterInterface implementation that acts as a stack of Emitters.

The implementations emit() method iterates itself.

When iterating the stack, the first emitter to return a boolean true value will short-circuit iteration.

Tags
template-extends

SplStack<EmitterInterface>

Table of Contents

Interfaces

EmitterInterface

Methods

emit()  : bool
Emit a response
offsetSet()  : void
Set an emitter on the stack by index.
push()  : void
Push an emitter to the stack.
unshift()  : void
Unshift an emitter to the stack.
validateEmitter()  : void
Validate that an emitter implements EmitterInterface.

Methods

emit()

Emit a response

public emit(ResponseInterface $response) : bool

Loops through the stack, calling emit() on each; any that return a boolean true value will short-circuit, skipping any remaining emitters in the stack.

As such, return a boolean false value from an emitter to indicate it cannot emit the response, allowing the next emitter to try.

Parameters
$response : ResponseInterface
Return values
bool

validateEmitter()

Validate that an emitter implements EmitterInterface.

private validateEmitter(mixed $emitter) : void
Parameters
$emitter : mixed
Tags
throws
InvalidEmitterException

For non-emitter instances.

psalm-assert

EmitterInterface $emitter


        
On this page

Search results