code: protected function ensureFileIsWritable($filePath)
      {
          if ((is_file($filePath) && !is_writable($filePath)) || (!is_file($filePath) && !is_writable(dirname($filePath)))) {
              throw new UnableWriteToFileException(sprintf('Unable to write to the file at %s.', $filePath));
          }
      }
docs: Tests file for writability. If the file doesn't exist, check
  the parent directory for writability so the file can be created.
  
  @throws \Jackiedo\DotenvEditor\Exceptions\UnableWriteToFileException
  
  @return void