code: protected function validateFile($filePath, $message = 'File', $allowEmpty = true)
      {
          if (! file_exists($filePath) || ! is_readable($filePath)) {
              throw new \RuntimeException("$message '{$filePath}' doesn't exist or is not readable.");
          }
  
          if (! $allowEmpty && 0 === filesize($filePath)) {
              throw new \RuntimeException("$message '{$filePath}' is empty.");
          }
  
          return realpath($filePath);
      }
docs: Validates the file exists, is readable and optionaly is not empty
  and returns an absolute path to the file.
  
  @param $filePath
  @param string $message
  
  @return string