X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FuserDupes.inc;h=69c926584e376d064b2c25b4eccb9ca809775d47;hb=228d796b1d6299ccd39418e85f40437292b47dd4;hp=15e1174f3ab3427c4ed0538c3420ae93b277d73e;hpb=1a8daf2c07e31337d83ee39b42873373023c8d40;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/userDupes.inc b/maintenance/userDupes.inc index 15e1174f3a..69c926584e 100644 --- a/maintenance/userDupes.inc +++ b/maintenance/userDupes.inc @@ -166,8 +166,8 @@ class UserDupes { * @access private */ function lock() { - $set = array( 'user', 'revision' ); - $names = array_map( array( $this, 'lockTable' ), $set ); + $set = [ 'user', 'revision' ]; + $names = array_map( [ $this, 'lockTable' ], $set ); $tables = implode( ',', $names ); $this->db->query( "LOCK TABLES $tables", __METHOD__ ); @@ -195,9 +195,9 @@ class UserDupes { "SELECT user_name,COUNT(*) AS n FROM $user GROUP BY user_name - HAVING n > 1", __METHOD__ ); + HAVING n > 1", __METHOD__ ); - $list = array(); + $list = []; foreach ( $result as $row ) { $list[] = $row->user_name; } @@ -215,8 +215,8 @@ class UserDupes { */ function examine( $name, $doDelete ) { $result = $this->db->select( 'user', - array( 'user_id' ), - array( 'user_name' => $name ), + [ 'user_id' ], + [ 'user_name' => $name ], __METHOD__ ); $firstRow = $this->db->fetchObject( $result ); @@ -266,7 +266,7 @@ class UserDupes { return intval( $this->db->selectField( 'revision', 'COUNT(*)', - array( 'rev_user' => $userid ), + [ 'rev_user' => $userid ], __METHOD__ ) ); } @@ -278,8 +278,8 @@ class UserDupes { function reassignEdits( $from, $to ) { $this->out( 'reassigning... ' ); $this->db->update( 'revision', - array( 'rev_user' => $to ), - array( 'rev_user' => $from ), + [ 'rev_user' => $to ], + [ 'rev_user' => $from ], __METHOD__ ); $this->out( "ok. " ); } @@ -291,7 +291,7 @@ class UserDupes { */ function trimAccount( $userid ) { $this->out( "deleting..." ); - $this->db->delete( 'user', array( 'user_id' => $userid ), __METHOD__ ); + $this->db->delete( 'user', [ 'user_id' => $userid ], __METHOD__ ); $this->out( " ok" ); } }