Merge "Delete autoload.ide.php"
[lhc/web/wiklou.git] / includes / filerepo / FileRepo.php
index 89bb81a..858e124 100644 (file)
@@ -7,6 +7,8 @@
  * @details
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * Base code for file repositories.
  *
@@ -638,11 +640,10 @@ class FileRepo {
         * @return string
         */
        public function getNameFromTitle( Title $title ) {
-               global $wgContLang;
                if ( $this->initialCapital != MWNamespace::isCapitalized( NS_FILE ) ) {
                        $name = $title->getUserCaseDBKey();
                        if ( $this->initialCapital ) {
-                               $name = $wgContLang->ucfirst( $name );
+                               $name = MediaWikiServices::getInstance()->getContentLanguage()->ucfirst( $name );
                        }
                } else {
                        $name = $title->getDBkey();
@@ -1177,11 +1178,7 @@ class FileRepo {
                if ( $status->successCount == 0 ) {
                        $status->setOK( false );
                }
-               if ( isset( $status->value[0] ) ) {
-                       $status->value = $status->value[0];
-               } else {
-                       $status->value = false;
-               }
+               $status->value = $status->value[0] ?? false;
 
                return $status;
        }
@@ -1354,7 +1351,7 @@ class FileRepo {
        }
 
        /**
-        * Checks existence of a file
+        * Checks existence of a file
         *
         * @param string $file Virtual URL (or storage path) of file to check
         * @return bool
@@ -1735,7 +1732,7 @@ class FileRepo {
         * @return Status
         */
        public function newFatal( $message /*, parameters...*/ ) {
-               $status = call_user_func_array( [ Status::class, 'newFatal' ], func_get_args() );
+               $status = Status::newFatal( ...func_get_args() );
                $status->cleanCallback = $this->getErrorCleanupFunction();
 
                return $status;
@@ -1840,7 +1837,7 @@ class FileRepo {
                $args = func_get_args();
                array_unshift( $args, 'filerepo', $this->getName() );
 
-               return call_user_func_array( 'wfMemcKey', $args );
+               return wfMemcKey( ...$args );
        }
 
        /**