Adjust type hints in file related classes
[lhc/web/wiklou.git] / includes / page / ImagePage.php
index 86c59ad..16b83d1 100644 (file)
@@ -29,7 +29,7 @@ use Wikimedia\Rdbms\ResultWrapper;
  * @ingroup Media
  */
 class ImagePage extends Article {
-       /** @var File */
+       /** @var File|false */
        private $displayImg;
 
        /** @var FileRepo */
@@ -75,9 +75,10 @@ class ImagePage extends Article {
 
                Hooks::run( 'ImagePageFindFile', [ $this, &$img, &$this->displayImg ] );
                if ( !$img ) { // not set by hook?
-                       $img = wfFindFile( $this->getTitle() );
+                       $services = MediaWikiServices::getInstance();
+                       $img = $services->getRepoGroup()->findFile( $this->getTitle() );
                        if ( !$img ) {
-                               $img = wfLocalFile( $this->getTitle() );
+                               $img = $services->getRepoGroup()->getLocalRepo()->newFile( $this->getTitle() );
                        }
                }
                $this->mPage->setFile( $img );
@@ -800,7 +801,7 @@ EOT
        }
 
        /**
-        * @param string $target
+        * @param string|string[] $target
         * @param int $limit
         * @return ResultWrapper
         */
@@ -934,7 +935,7 @@ EOT
                                ) . "\n"
                        );
 
-               };
+               }
                $out->addHTML( Html::closeElement( 'ul' ) . "\n" );
                $res->free();