public function close() : void
    {
        if ($this->stream !== null) {
            if ($this->isPipe === true) {
                // @codeCoverageIgnoreStart
                pclose($this->stream);
                // @codeCoverageIgnoreEnd
            } else {
                fclose($this->stream);
            }
        }

        $this->detach();
    }