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" );
*/
private function userConditions( &$user, $idfield, $utfield ) {
return $user->getId()
- ? array( $idfield => $user->getId() )
- : array( $utfield => $user->getName() );
+ ? [ $idfield => $user->getId() ]
+ : [ $utfield => $user->getName() ];
}
/**
* @return array
*/
private function userSpecification( &$user, $idfield, $utfield ) {
- return array( $idfield => $user->getId(), $utfield => $user->getName() );
+ return [ $idfield => $user->getId(), $utfield => $user->getName() ];
}
/**
} else {
$user = User::newFromName( $username );
if ( !$user ) {
- $this->error( "Invalid username", true );
+ $this->fatalError( "Invalid username" );
}
}
$user->load();