Merge "maintenance: Script to rename titles for Unicode uppercasing changes"
[lhc/web/wiklou.git] / includes / filerepo / ForeignAPIRepo.php
index 9e4b6df..8ff8143 100644 (file)
@@ -184,7 +184,7 @@ class ForeignAPIRepo extends FileRepo {
 
        /**
         * @param array $query
-        * @return string
+        * @return array|null
         */
        function fetchImageQuery( $query ) {
                global $wgLanguageCode;
@@ -348,14 +348,11 @@ class ForeignAPIRepo extends FileRepo {
                if ( !$knownThumbUrls ) {
                        /* No knownThumbUrls for this file */
                        $knownThumbUrls = [];
-               } else {
-                       if ( isset( $knownThumbUrls[$sizekey] ) ) {
-                               wfDebug( __METHOD__ . ': Got thumburl from local cache: ' .
-                                       "{$knownThumbUrls[$sizekey]} \n" );
+               } elseif ( isset( $knownThumbUrls[$sizekey] ) ) {
+                       wfDebug( __METHOD__ . ': Got thumburl from local cache: ' .
+                               "{$knownThumbUrls[$sizekey]} \n" );
 
-                               return $knownThumbUrls[$sizekey];
-                       }
-                       /* This size is not yet known */
+                       return $knownThumbUrls[$sizekey];
                }
 
                $metadata = null;
@@ -505,8 +502,9 @@ class ForeignAPIRepo extends FileRepo {
        }
 
        /**
-        * Like a Http:get request, but with custom User-Agent.
-        * @see Http::get
+        * Like a HttpRequestFactory::get request, but with custom User-Agent.
+        * @see HttpRequestFactory::get
+        * @todo Can this use HttpRequestFactory::get() but just pass the 'userAgent' option?
         * @param string $url
         * @param string $timeout
         * @param array $options