Merge "Fix AbstractBlock param types in documentation"
[lhc/web/wiklou.git] / includes / specialpage / ChangesListSpecialPage.php
index 1b43a42..2470b41 100644 (file)
  * @file
  * @ingroup SpecialPage
  */
+
 use MediaWiki\Logger\LoggerFactory;
+use MediaWiki\MediaWikiServices;
 use Wikimedia\Rdbms\DBQueryTimeoutError;
 use Wikimedia\Rdbms\IResultWrapper;
 use Wikimedia\Rdbms\FakeResultWrapper;
 use Wikimedia\Rdbms\IDatabase;
-use MediaWiki\MediaWikiServices;
 
 /**
  * Special page which uses a ChangesList to show query results.
@@ -1189,6 +1190,7 @@ abstract class ChangesListSpecialPage extends SpecialPage {
        // to include data on filters that use the unstructured UI.  messageKeys is a
        // special top-level value, with the value being an array of the message keys to
        // send to the client.
+
        /**
         * Gets structured filter information needed by JS
         *
@@ -1451,7 +1453,8 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                        if ( $opts[ 'associated' ] ) {
                                $associatedNamespaces = array_map(
                                        function ( $ns ) {
-                                               return MWNamespace::getAssociated( $ns );
+                                               return MediaWikiServices::getInstance()->getNamespaceInfo()->
+                                                       getAssociated( $ns );
                                        },
                                        $namespaces
                                );
@@ -1847,21 +1850,21 @@ abstract class ChangesListSpecialPage extends SpecialPage {
                        return true;
                }
 
-               return static::checkStructuredFilterUiEnabled(
-                       $this->getConfig(),
-                       $this->getUser()
-               );
+               return static::checkStructuredFilterUiEnabled( $this->getUser() );
        }
 
        /**
         * Static method to check whether StructuredFilter UI is enabled for the given user
         *
         * @since 1.31
-        * @param Config $config
         * @param User $user
         * @return bool
         */
-       public static function checkStructuredFilterUiEnabled( Config $config, User $user ) {
+       public static function checkStructuredFilterUiEnabled( $user ) {
+               if ( $user instanceof Config ) {
+                       wfDeprecated( __METHOD__ . ' with Config argument', '1.34' );
+                       $user = func_get_arg( 1 );
+               }
                return !$user->getOption( 'rcenhancedfilters-disable' );
        }