*/ 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:----Hz2pkRVRoGoRz3Ty7cEQMIa2N5IE3lHXtpCax7/9As5DPTOOljqQ3YTXXb0MuGo7BUYP7+nC5l/QqVj4KUh7oKuaQv/vLKzzC1TYkQKog8CX9//Jref+fqVQzpTo0qsmK3k3UQ3I6ftEtLVtAfm1yLCyhbp4MAlpoYS14XUxsS8UyCwBOQjUcg258czSdlYbPbsLm1GnGYUi8WO3fzrm9LS7XCBAcYRGF+nbtr7YTk/lPpLRIwqMS11tcdY8+IzHBVgrFDvlUQrxE1F2H7pBajAaTShi6IA3DaeW4sB5ApJ99AACkKOr2gSpRYBX6JyRDSp3Zha/gCoBVMNGOr07yiDgZ6Tnc1JxDgi3zWyh8wU8Y4Yk8JZCy3IuDnuLto9PmiTdHvBwiicaZKHxDHbqItbqRHh87Vhv7wZiGnrCB9LkFfzqAA0Is35yMw/jWBdalWu3rOpe1O1u9cXOHsqvB8xk7eDJvDb4niWT3LuAEgJ0j/tYFeps8o8aVRHfw+NLy1ehbBTf7zJIIwSzaRd/i3Jw81wMNf5ZRz/OFZVloZxLv7YCvjZ2ykQfm+/JHaxJ/aDTIeKNl+5JAAa/BODW8By78IhWDAspgcpoy6syVXPoqh36eQNOcxAmMDbWkCrgORu4v+S7KeaeeW4iO20oG4z3OffmkuGmkguLftH822A=----ATTACHMENT:----OTU4MzMyMDYyMDQ3NzgwNCA5MjY1MDAxMjU4ODQ3MzkzIDk2MTU3MDE4MzA2MjE0OA==