Merge "Require indentation of CASE statements in PHP code"
[lhc/web/wiklou.git] / maintenance / namespaceDupes.php
index b705500..84d4533 100644 (file)
  * @ingroup Maintenance
  */
 
-use MediaWiki\Linker\LinkTarget;
-
 require_once __DIR__ . '/Maintenance.php';
 
+use MediaWiki\Linker\LinkTarget;
+use MediaWiki\MediaWikiServices;
+use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\IMaintainableDatabase;
+
 /**
  * Maintenance script that checks for articles to fix after
  * adding/deleting namespaces.
@@ -37,7 +40,7 @@ require_once __DIR__ . '/Maintenance.php';
 class NamespaceConflictChecker extends Maintenance {
 
        /**
-        * @var Database
+        * @var IMaintainableDatabase
         */
        protected $db;
 
@@ -224,7 +227,7 @@ class NamespaceConflictChecker extends Maintenance {
         * @return array
         */
        private function getInterwikiList() {
-               $result = Interwiki::getAllPrefixes();
+               $result = MediaWikiServices::getInstance()->getInterwikiLookup()->getAllPrefixes();
                $prefixes = [];
                foreach ( $result as $row ) {
                        $prefixes[] = $row['iw_prefix'];
@@ -253,7 +256,6 @@ class NamespaceConflictChecker extends Maintenance {
 
                $ok = true;
                foreach ( $targets as $row ) {
-
                        // Find the new title and determine the action to take
 
                        $newTitle = $this->getDestinationTitle( $ns, $name,
@@ -457,10 +459,10 @@ class NamespaceConflictChecker extends Maintenance {
 
        /**
         * Get the preferred destination title for a given target page.
-        * @param integer $ns The destination namespace ID
+        * @param int $ns The destination namespace ID
         * @param string $name The conflicting prefix
-        * @param integer $sourceNs The source namespace
-        * @param integer $sourceDbk The source DB key (i.e. page_title)
+        * @param int $sourceNs The source namespace
+        * @param int $sourceDbk The source DB key (i.e. page_title)
         * @param array $options Associative array of validated command-line options
         * @return Title|false
         */
@@ -570,7 +572,7 @@ class NamespaceConflictChecker extends Maintenance {
        /**
         * Merge page histories
         *
-        * @param integer $id The page_id
+        * @param stdClass $row Page row
         * @param Title $newTitle The new title
         * @return bool
         */