/** * {@inheritDoc} */ public function open($flags, $mode = AdapterInterface::CREATION_MODE) { if ($this->open === true) { return new RejectedPromise(); } return $this->adapter->open($this->path, $flags, $mode)->then(function (GenericStreamInterface $stream) { $this->open = true; $this->fileDescriptor = $stream->getFiledescriptor(); return $stream; }); }