public function close(): void
    {
        // If there is no stream
        if (null === $this->stream) {
            // Don't do anything
            return;
        }

        // Detach the stream
        $resource = $this->detach();

        // Close the stream
        fclose($resource);
    }