PHP Class Zend\Expressive\Emitter\EmitterStack

The implementations emit() method iterates itself. When iterating the stack, the first emitter to return a value that is not identical to boolean false will short-circuit iteration.
Inheritance: extends SplStac\SplStack, implements Zend\Diactoros\Response\EmitterInterface
Show file Open project: zendframework/zend-expressive Class Usage Examples

Public Methods

Method Description
emit ( Psr\Http\Message\ResponseInterface $response ) : false | null Emit a response
offsetSet ( mixed $index, Zend\Diactoros\Response\EmitterInterface $emitter ) Set an emitter on the stack by index.
push ( Zend\Diactoros\Response\EmitterInterface $emitter ) Push an emitter to the stack.
unshift ( Zend\Diactoros\Response\EmitterInterface $emitter ) Unshift an emitter to the stack.

Private Methods

Method Description
validateEmitter ( mixed $emitter ) Validate that an emitter implements EmitterInterface.

Method Details

emit() public method

Loops through the stack, calling emit() on each; any that return a value other than boolean false 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.
public emit ( Psr\Http\Message\ResponseInterface $response ) : false | null
$response Psr\Http\Message\ResponseInterface
return false | null

offsetSet() public method

Set an emitter on the stack by index.
public offsetSet ( mixed $index, Zend\Diactoros\Response\EmitterInterface $emitter )
$index mixed
$emitter Zend\Diactoros\Response\EmitterInterface

push() public method

Push an emitter to the stack.
public push ( Zend\Diactoros\Response\EmitterInterface $emitter )
$emitter Zend\Diactoros\Response\EmitterInterface

unshift() public method

Unshift an emitter to the stack.
public unshift ( Zend\Diactoros\Response\EmitterInterface $emitter )
$emitter Zend\Diactoros\Response\EmitterInterface