code: protected function determineFileType($path)
      {
          if (!function_exists('finfo_open')) {
              // File info functions not available
              return;
          }
  
          // Determine file type
          $finfo = finfo_open(\FILEINFO_MIME_TYPE);
          $type = finfo_file($finfo, $path);
  
          finfo_close($finfo);
  
          if ($type === false) {
              // Could not determine file type
              return;
          }
  
          return $type;
      }
docs: @param string $path
  
  @throws \RuntimeException
  
  @return string