- // Build mapping from special page names to QueryPage classes
- $uselessQueryPages = $this->getConfig()->get( 'APIUselessQueryPages' );
- $this->qpMap = [];
- foreach ( QueryPage::getPages() as $page ) {
- if ( !in_array( $page[1], $uselessQueryPages ) ) {
- $this->qpMap[$page[1]] = $page[0];
- }
- }
+ $this->queryPages = array_values( array_diff(
+ array_column( QueryPage::getPages(), 1 ), // [ class, name ]
+ $this->getConfig()->get( 'APIUselessQueryPages' )
+ ) );
+ $this->specialPageFactory = MediaWikiServices::getInstance()->getSpecialPageFactory();