Merge "Re add wpScrolltop id in EditPage"
[lhc/web/wiklou.git] / maintenance / reassignEdits.php
index 4d1c537..7a0e4fc 100644 (file)
@@ -34,7 +34,7 @@ require_once __DIR__ . '/Maintenance.php';
 class ReassignEdits extends Maintenance {
        public function __construct() {
                parent::__construct();
-               $this->mDescription = "Reassign edits from one user to another";
+               $this->addDescription( 'Reassign edits from one user to another' );
                $this->addOption( "force", "Reassign even if the target user doesn't exist" );
                $this->addOption( "norc", "Don't update the recent changes table" );
                $this->addOption( "report", "Print out details of what would be changed, but don't update it" );
@@ -74,7 +74,7 @@ class ReassignEdits extends Maintenance {
         * @return int Number of entries changed, or that would be changed
         */
        private function doReassignEdits( &$from, &$to, $rc = false, $report = false ) {
-               $dbw = wfGetDB( DB_MASTER );
+               $dbw = $this->getDB( DB_MASTER );
                $this->beginTransaction( $dbw, __METHOD__ );
 
                # Count things
@@ -155,8 +155,8 @@ class ReassignEdits extends Maintenance {
         */
        private function userConditions( &$user, $idfield, $utfield ) {
                return $user->getId()
-                       ? array( $idfield => $user->getId() )
-                       : array( $utfield => $user->getName() );
+                       ? [ $idfield => $user->getId() ]
+                       : [ $utfield => $user->getName() ];
        }
 
        /**
@@ -169,7 +169,7 @@ class ReassignEdits extends Maintenance {
         * @return array
         */
        private function userSpecification( &$user, $idfield, $utfield ) {
-               return array( $idfield => $user->getId(), $utfield => $user->getName() );
+               return [ $idfield => $user->getId(), $utfield => $user->getName() ];
        }
 
        /**