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