* @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.
*
* There is light processing to simplify core maintenance.
* @param array $definition
+ * @phan-param array<int,array{class:string}> $definition
*/
protected function registerFiltersFromDefinitions( array $definition ) {
$autoFillPriority = -1;
// 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
*
if ( $opts[ 'associated' ] ) {
$associatedNamespaces = array_map(
function ( $ns ) {
- return MWNamespace::getAssociated( $ns );
+ return MediaWikiServices::getInstance()->getNamespaceInfo()->
+ getAssociated( $ns );
},
$namespaces
);
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' );
}