Merge "Rewrite pref cleanup script"
[lhc/web/wiklou.git] / includes / api / ApiQueryInfo.php
index ecdebd4..5294b1d 100644 (file)
@@ -1,9 +1,5 @@
 <?php
 /**
- *
- *
- * Created on Sep 25, 2006
- *
  * Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
  *
  * This program is free software; you can redistribute it and/or modify
@@ -107,15 +103,15 @@ class ApiQueryInfo extends ApiQueryBase {
                }
 
                $this->tokenFunctions = [
-                       'edit' => [ 'ApiQueryInfo', 'getEditToken' ],
-                       'delete' => [ 'ApiQueryInfo', 'getDeleteToken' ],
-                       'protect' => [ 'ApiQueryInfo', 'getProtectToken' ],
-                       'move' => [ 'ApiQueryInfo', 'getMoveToken' ],
-                       'block' => [ 'ApiQueryInfo', 'getBlockToken' ],
-                       'unblock' => [ 'ApiQueryInfo', 'getUnblockToken' ],
-                       'email' => [ 'ApiQueryInfo', 'getEmailToken' ],
-                       'import' => [ 'ApiQueryInfo', 'getImportToken' ],
-                       'watch' => [ 'ApiQueryInfo', 'getWatchToken' ],
+                       'edit' => [ self::class, 'getEditToken' ],
+                       'delete' => [ self::class, 'getDeleteToken' ],
+                       'protect' => [ self::class, 'getProtectToken' ],
+                       'move' => [ self::class, 'getMoveToken' ],
+                       'block' => [ self::class, 'getBlockToken' ],
+                       'unblock' => [ self::class, 'getUnblockToken' ],
+                       'email' => [ self::class, 'getEmailToken' ],
+                       'import' => [ self::class, 'getImportToken' ],
+                       'watch' => [ self::class, 'getWatchToken' ],
                ];
                Hooks::run( 'APIQueryInfoTokens', [ &$this->tokenFunctions ] );
 
@@ -318,7 +314,7 @@ class ApiQueryInfo extends ApiQueryBase {
                $this->everything = $this->titles + $this->missing;
                $result = $this->getResult();
 
-               uasort( $this->everything, [ 'Title', 'compare' ] );
+               uasort( $this->everything, [ Title::class, 'compare' ] );
                if ( !is_null( $this->params['continue'] ) ) {
                        // Throw away any titles we're gonna skip so they don't
                        // clutter queries
@@ -372,7 +368,7 @@ class ApiQueryInfo extends ApiQueryBase {
                        $this->getDisplayTitle();
                }
 
-               /** @var $title Title */
+               /** @var Title $title */
                foreach ( $this->everything as $pageid => $title ) {
                        $pageInfo = $this->extractPageInfo( $pageid, $title );
                        $fit = $pageInfo !== null && $result->addValue( [
@@ -548,7 +544,7 @@ class ApiQueryInfo extends ApiQueryBase {
 
                        $res = $this->select( __METHOD__ );
                        foreach ( $res as $row ) {
-                               /** @var $title Title */
+                               /** @var Title $title */
                                $title = $this->titles[$row->pr_page];
                                $a = [
                                        'type' => $row->pr_type,
@@ -688,7 +684,7 @@ class ApiQueryInfo extends ApiQueryBase {
        private function getTSIDs() {
                $getTitles = $this->talkids = $this->subjectids = [];
 
-               /** @var $t Title */
+               /** @var Title $t */
                foreach ( $this->everything as $t ) {
                        if ( MWNamespace::isTalk( $t->getNamespace() ) ) {
                                if ( $this->fld_subjectid ) {