protected function ensureFileIsWritable()
    {
        if ((!is_writable($this->filePath) || !is_file($this->filePath))
            && (!is_dir(dirname($this->filePath)) || !is_writable(dirname($this->filePath)))
        ) {
            throw new InvalidPathException(sprintf('Unable to write the environment file at %s.', $this->filePath));
        }
    }