*/ final class AutoDisposingPipeline implements Pipeline { /** @var EmitSource */ private EmitSource $source; public function __construct(EmitSource $source) { $this->source = $source; } public function __destruct() { $this->source->destroy(); } /** * @inheritDoc */ public function continue(): mixed { return $this->source->continue(); } /** * @inheritDoc */ public function dispose(): void { $this->source->dispose(); } }