Merge "Use {{int:}} on MediaWiki:Blockedtext and MediaWiki:Autoblockedtext"
[lhc/web/wiklou.git] / includes / filerepo / file / ArchivedFile.php
index 982fea4..65e4345 100644 (file)
@@ -21,6 +21,8 @@
  * @ingroup FileAbstraction
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * Class representing a row of the 'filearchive' table
  *
@@ -214,7 +216,7 @@ class ArchivedFile {
        /**
         * Fields in the filearchive table
         * @deprecated since 1.31, use self::getQueryInfo() instead.
-        * @return array
+        * @return string[]
         */
        static function selectFields() {
                global $wgActorTableSchemaMigrationStage;
@@ -251,20 +253,20 @@ class ArchivedFile {
                        'fa_deleted',
                        'fa_deleted_timestamp', /* Used by LocalFileRestoreBatch */
                        'fa_sha1',
-               ] + CommentStore::getStore()->getFields( 'fa_description' );
+               ] + MediaWikiServices::getInstance()->getCommentStore()->getFields( 'fa_description' );
        }
 
        /**
         * Return the tables, fields, and join conditions to be selected to create
         * a new archivedfile object.
         * @since 1.31
-        * @return array With three keys:
+        * @return array[] With three keys:
         *   - tables: (string[]) to include in the `$table` to `IDatabase->select()`
         *   - fields: (string[]) to include in the `$vars` to `IDatabase->select()`
         *   - joins: (array) to include in the `$join_conds` to `IDatabase->select()`
         */
        public static function getQueryInfo() {
-               $commentQuery = CommentStore::getStore()->getJoin( 'fa_description' );
+               $commentQuery = MediaWikiServices::getInstance()->getCommentStore()->getJoin( 'fa_description' );
                $actorQuery = ActorMigration::newMigration()->getJoin( 'fa_user' );
                return [
                        'tables' => [ 'filearchive' ] + $commentQuery['tables'] + $actorQuery['tables'],
@@ -310,7 +312,7 @@ class ArchivedFile {
                $this->metadata = $row->fa_metadata;
                $this->mime = "$row->fa_major_mime/$row->fa_minor_mime";
                $this->media_type = $row->fa_media_type;
-               $this->description = CommentStore::getStore()
+               $this->description = MediaWikiServices::getInstance()->getCommentStore()
                        // Legacy because $row may have come from self::selectFields()
                        ->getCommentLegacy( wfGetDB( DB_REPLICA ), 'fa_description', $row )->text;
                $this->user = User::newFromAnyId( $row->fa_user, $row->fa_user_text, $row->fa_actor );