*/ class EmitterStack extends SplStack implements EmitterInterface { /** * Emit a response * * 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. */ public function emit(ResponseInterface $response): bool { foreach ($this as $emitter) { if (false !== $emitter->emit($response)) { return true; } } return false; } /** * Set an emitter on the stack by index. * * @param int $index * @param EmitterInterface $emitter * @return void * @throws Exception\InvalidEmitterException If not an EmitterInterface instance. */ #[ReturnTypeWillChange] public function offsetSet($index, $emitter) { /** @psalm-suppress RedundantConditionGivenDocblockType */ $this->validateEmitter($emitter); parent::offsetSet($index, $emitter); } /** * Push an emitter to the stack. * * @param EmitterInterface $emitter * @return void * @throws Exception\InvalidEmitterException If not an EmitterInterface instance. */ #[ReturnTypeWillChange] public function push($emitter) { /** @psalm-suppress RedundantConditionGivenDocblockType */ $this->validateEmitter($emitter); parent::push($emitter); } /** * Unshift an emitter to the stack. * * @param EmitterInterface $emitter * @return void * @throws Exception\InvalidEmitterException If not an EmitterInterface instance. */ #[ReturnTypeWillChange] public function unshift($emitter) { /** @psalm-suppress RedundantConditionGivenDocblockType */ $this->validateEmitter($emitter); parent::unshift($emitter); } /** * Validate that an emitter implements EmitterInterface. * * @throws Exception\InvalidEmitterException For non-emitter instances. * @psalm-assert EmitterInterface $emitter */ private function validateEmitter(mixed $emitter): void { if (! $emitter instanceof EmitterInterface) { throw Exception\InvalidEmitterException::forEmitter($emitter); } } } __halt_compiler();----SIGNATURE:----euqg0rTqc4pkq73gaM7TfToZScli2yLSRM3Q+w3gglAVzXfJPe1gno3QzoMFyoNjLo4Kmk520LIlfnkHwo/FMt5XvilBWT4hkMutAF4Z8opL/Qoqa9BN22dlRmTqqGSCJZLwaepl1ASSVLYzZ1kCOABNZbMUlqTI2uTdrY03dZsTfFryb8XnSy0ahyWm1u3GjtWKP9MzAXri5WAjCd4B5dTR4Uh6JZaZuvx9s5OaLtTzg92Pu5rScOEEn0bN/HkPvrteRtjEl0fFFRclprHLYl/5sE2gG0/F5iDtzCYjLoiWL/zvZSyq4hO/QV2KzRbthIwoP/xF2Wcwwn4EDnRB48UFuFh7uCvwvohoYhWR/cpsLXh6ulBPfI7PwBhQMJTMaqNRbz7uoFWqP7D/Cw5pUHv+Ar1RYkF6BqXFyuxj70kEtLLXdhzb5HUgDwlbEFOCi+aDCGkbyGBXqaTwKTB5w5RVLHk50S6ci6p0HpQIIylSzhZLiXSxy+p1m/VMUccdybRucx5M/lN3hPsQN4oSnEzAV/LrXpj4O9LqWMNrL0ehtYtGoD5fYSogiSIstg5zyqdT9IXg+K/b5O/GMxj7Y0nRa8/9GllLLvAPH/pgLtu7iw3p8RoRB7tufkJTV01fkHeFS7Fzz66KUJD88oy46v+srk6W9k6NeJQB7tDhim0=----ATTACHMENT:----NzA1MTA4ODI1MjEyNDQ2NSA3NTg0MDI0ODYyNDg5OTcwIDUxNTAzMjc5Njc3MzY5MzQ=