Merge pull request #17345 from eileenmcnaughton/ev_batch
[civicrm-core.git] / CRM / Utils / File.php
index 85700778f4271b9ed7b8af0e1ddd5cf986bb7afc..3ad79207b6711b83df29cfa8e54449c9c3f6b2a2 100644 (file)
@@ -399,7 +399,7 @@ class CRM_Utils_File {
       }
     }
     // support lower and uppercase file extensions
-    return isset($extensions[strtolower($ext)]) ? TRUE : FALSE;
+    return (bool) isset($extensions[strtolower($ext)]);
   }
 
   /**
@@ -1066,7 +1066,7 @@ HTACCESS;
    */
   public static function isValidFileName($fileName = NULL) {
     if ($fileName) {
-      $check = $fileName !== basename($fileName) ? FALSE : TRUE;
+      $check = ($fileName === basename($fileName));
       if ($check) {
         if (substr($fileName, 0, 1) == '/' || substr($fileName, 0, 1) == '.' || substr($fileName, 0, 1) == DIRECTORY_SEPARATOR) {
           $check = FALSE;
@@ -1082,7 +1082,7 @@ HTACCESS;
    * @param string $mimeType the mime-type we want extensions for
    * @return array
    */
-  public static function getAcceptableExtensionsForMimeType($mimeType = NULL) {
+  public static function getAcceptableExtensionsForMimeType($mimeType = []) {
     $mimeRepostory = new \MimeTyper\Repository\ExtendedRepository();
     return $mimeRepostory->findExtensions($mimeType);
   }