*/ final class AutoDisposingStream implements Stream { /** @var EmitSource */ private $source; public function __construct(EmitSource $source) { $this->source = $source; } public function __destruct() { $this->source->dispose(); } /** * @inheritDoc */ public function continue(): Promise { return $this->source->continue(); } /** * @inheritDoc */ public function dispose() { $this->source->dispose(); } }