FileRepo: Use Late Static Binding in File static constructors
[lhc/web/wiklou.git] / includes / filerepo / file / UnregisteredLocalFile.php
index b22f8cb..2865ce5 100644 (file)
@@ -55,19 +55,19 @@ class UnregisteredLocalFile extends File {
        /**
         * @param string $path Storage path
         * @param string $mime
-        * @return UnregisteredLocalFile
+        * @return static
         */
        static function newFromPath( $path, $mime ) {
-               return new self( false, false, $path, $mime );
+               return new static( false, false, $path, $mime );
        }
 
        /**
         * @param Title $title
         * @param FileRepo $repo
-        * @return UnregisteredLocalFile
+        * @return static
         */
        static function newFromTitle( $title, $repo ) {
-               return new self( $title, $repo, false, false );
+               return new static( $title, $repo, false, false );
        }
 
        /**
@@ -151,7 +151,7 @@ class UnregisteredLocalFile extends File {
         */
        function getMimeType() {
                if ( !isset( $this->mime ) ) {
-                       $magic = MimeMagic::singleton();
+                       $magic = MediaWiki\MediaWikiServices::getInstance()->getMimeAnalyzer();
                        $this->mime = $magic->guessMimeType( $this->getLocalRefPath() );
                }
 
@@ -171,8 +171,8 @@ class UnregisteredLocalFile extends File {
        }
 
        /**
-       * @return int
-       */
+        * @return int
+        */
        function getBitDepth() {
                $gis = $this->getImageSize( $this->getLocalRefPath() );