public function close()
    {
        if (!$this->isOpened()) {
            return;
        }

        $this->unlock();

        if ($this->handle && !fclose($this->handle)) {
            throw new \RuntimeException("Could not close file " . $this->filePath);
        }
    }