original_string: public static function validateExtension($fileName, $allowedExtensions, $allowEmpty = true)
      {
          $extension = strtolower(pathinfo($fileName, PATHINFO_EXTENSION));
          if (empty($extension)) {
              return $allowEmpty;
          }
  
          return in_array($extension, $allowedExtensions);
      }
code: public static function validateExtension($fileName, $allowedExtensions, $allowEmpty = true)
      {
          $extension = strtolower(pathinfo($fileName, PATHINFO_EXTENSION));
          if (empty($extension)) {
              return $allowEmpty;
          }
  
          return in_array($extension, $allowedExtensions);
      }
code_tokens: public static function validateExtension ( $ fileName , $ allowedExtensions , $ allowEmpty = true ) { $ extension = strtolower ( pathinfo ( $ fileName , PATHINFO_EXTENSION ) ) ; if ( empty ( $ extension ) ) { return $ allowEmpty ; } return in_array ( $ extension , $ allowedExtensions ) ; }
docstring: Validates whether a file has an allowed extension.
  @param string $fileName Specifies a path to validate
  @param array $allowedExtensions A list of allowed file extensions
  @param boolean $allowEmpty Determines whether the file extension could be empty.
  @return boolean Returns true if the file extension is valid. Otherwise returns false.
docstring_tokens: Validates whether a file has an allowed extension .