*/ 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:----QsQJF9BxlNDi4D2IzHBcZ91T92RiDlr/6+7LjeTN9Vkwg2SPIkYoea+mVqs4XgbpuOmeXAoUCN8jEIBrWvQXZmDOXTcGgvJVNQq1WXgjt67gsD7kvUGLPpZIl91I7BVxq37vFj6PG+0vrznbHe9j2xDIHODWvNH413UhXNlOcECs+Oz8OiNP2Gd5ngefRh2oOrIf3mgI3rf40WwkvkaGOATd2FpKvsBJnL4zYfk8Pb+tLU9bEu96t8z7NfpL/UwaXinlOHZwtCZYSUKu5MAH7lMvD6NGTbhvpmgZwjm+zgRlUMRDxFkCRigWAqzxxOHErwRR+57acwXa8NJQGKM6+XRkIaw4/e8keCvSsouurkGv9MqSDxK1RCE+qkLqBnE8KpONWXYeZhJBk3kbU8xnQLlfljN+H2jxZa0BcVF7nM+Ct/ZhUwRA5zTlkMcjArOucxVUCkmxAmvD/ZVoZ4KX2Cto+xK41dG2R8sGl2EyvpR1kUNBILrDionyydfi2/G4xpo8kBrNlyvQCs3HoWjUxP55LN2w9sUdnA1Tpe6KpQJK14l6ITd51xhWImkO4YhvufRJFqtjxTNtv8fZ7KRnOaV/id8s0D5yEVnKzrGc5jcR/Q2lC6ypPVbLZbOAvgRr/1fJiEeEM0NzQtfzYAP7TJkDBQ5klu/7khkvE8SbNf0=----ATTACHMENT:----Mzk1MzYzMDkyODM0Mjk4NSA0MTg3NTgxNDU0OTI1MzA4IDgzNDg2MjE5Mjg3MTgzOTM=