Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/324854

Change subject: Convert array() to []
......................................................................

Convert array() to []

Change-Id: I915817daedb7cd9201da5fee5fe0db57f90f0f84
---
M CheckUser.hooks.php
M CheckUser.php
M CheckUserEncryptedData.php
M CheckUserLogPager.php
M api/ApiQueryCheckUser.php
M api/ApiQueryCheckUserLog.php
M maintenance/importCheckUserLogs.php
M maintenance/populateCheckUserTable.php
M maintenance/purgeOldData.php
M phpcs.xml
M specials/SpecialCheckUser.php
M specials/SpecialCheckUserLog.php
12 files changed, 271 insertions(+), 274 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CheckUser 
refs/changes/54/324854/1

diff --git a/CheckUser.hooks.php b/CheckUser.hooks.php
index 00730b4..fcf6fdd 100755
--- a/CheckUser.hooks.php
+++ b/CheckUser.hooks.php
@@ -56,7 +56,7 @@
 
                $dbw = wfGetDB( DB_MASTER );
                $cuc_id = $dbw->nextSequenceValue( 'cu_changes_cu_id_seq' );
-               $rcRow = array(
+               $rcRow = [
                        'cuc_id'         => $cuc_id,
                        'cuc_namespace'  => $attribs['rc_namespace'],
                        'cuc_title'      => $attribs['rc_title'],
@@ -74,13 +74,13 @@
                        'cuc_xff'        => !$isSquidOnly ? $xff : '',
                        'cuc_xff_hex'    => ( $xff_ip && !$isSquidOnly ) ? 
IP::toHex( $xff_ip ) : null,
                        'cuc_agent'      => $agent
-               );
+               ];
                # On PG, MW unsets cur_id due to schema incompatibilites. So it 
may not be set!
                if ( isset( $attribs['rc_cur_id'] ) ) {
                        $rcRow['cuc_page_id'] = $attribs['rc_cur_id'];
                }
 
-               Hooks::run( 'CheckUserInsertForRecentChange', array( $rc, 
&$rcRow ) );
+               Hooks::run( 'CheckUserInsertForRecentChange', [ $rc, &$rcRow ] 
);
                $dbw->insert( 'cu_changes', $rcRow, __METHOD__ );
 
                return true;
@@ -105,7 +105,7 @@
                $agent = $wgRequest->getHeader( 'User-Agent' );
                $dbw = wfGetDB( DB_MASTER );
                $cuc_id = $dbw->nextSequenceValue( 'cu_changes_cu_id_seq' );
-               $rcRow = array(
+               $rcRow = [
                        'cuc_id'         => $cuc_id,
                        'cuc_namespace'  => NS_USER,
                        'cuc_title'      => '',
@@ -124,7 +124,7 @@
                        'cuc_xff'        => !$isSquidOnly ? $xff : '',
                        'cuc_xff_hex'    => ( $xff_ip && !$isSquidOnly ) ? 
IP::toHex( $xff_ip ) : null,
                        'cuc_agent'      => $agent
-               );
+               ];
                $dbw->insert( 'cu_changes', $rcRow, __METHOD__ );
 
                return true;
@@ -160,7 +160,7 @@
                $agent = $wgRequest->getHeader( 'User-Agent' );
                $dbw = wfGetDB( DB_MASTER );
                $cuc_id = $dbw->nextSequenceValue( 'cu_changes_cu_id_seq' );
-               $rcRow = array(
+               $rcRow = [
                        'cuc_id'         => $cuc_id,
                        'cuc_namespace'  => NS_USER,
                        'cuc_title'      => '',
@@ -179,11 +179,11 @@
                        'cuc_xff'        => !$isSquidOnly ? $xff : '',
                        'cuc_xff_hex'    => ( $xff_ip && !$isSquidOnly ) ? 
IP::toHex( $xff_ip ) : null,
                        'cuc_agent'      => $agent
-               );
+               ];
                if ( trim( $wgCUPublicKey ) != '' ) {
                        $privateData = $userTo->getEmail() . ":" . 
$userTo->getId();
                        $encryptedData = new CheckUserEncryptedData( 
$privateData, $wgCUPublicKey );
-                       $rcRow = array_merge( $rcRow, array( 'cuc_private' => 
serialize( $encryptedData ) ) );
+                       $rcRow = array_merge( $rcRow, [ 'cuc_private' => 
serialize( $encryptedData ) ] );
                }
 
                $dbw->insert( 'cu_changes', $rcRow, __METHOD__ );
@@ -223,7 +223,7 @@
                $agent = $wgRequest->getHeader( 'User-Agent' );
                $dbw = wfGetDB( DB_MASTER );
                $cuc_id = $dbw->nextSequenceValue( 'cu_changes_cu_id_seq' );
-               $rcRow = array(
+               $rcRow = [
                        'cuc_id'         => $cuc_id,
                        'cuc_page_id'    => 0,
                        'cuc_namespace'  => NS_USER,
@@ -242,7 +242,7 @@
                        'cuc_xff'        => !$isSquidOnly ? $xff : '',
                        'cuc_xff_hex'    => ( $xff_ip && !$isSquidOnly ) ? 
IP::toHex( $xff_ip ) : null,
                        'cuc_agent'      => $agent
-               );
+               ];
                $dbw->insert( 'cu_changes', $rcRow, __METHOD__ );
 
                return true;
@@ -262,13 +262,13 @@
                                $encCutoff = $dbw->addQuotes( $dbw->timestamp( 
time() - $wgCUDMaxAge ) );
                                $ids = $dbw->selectFieldValues( 'cu_changes',
                                        'cuc_id',
-                                       array( "cuc_timestamp < $encCutoff" ),
+                                       [ "cuc_timestamp < $encCutoff" ],
                                        $fname,
-                                       array( 'LIMIT' => 500 )
+                                       [ 'LIMIT' => 500 ]
                                );
 
                                if ( $ids ) {
-                                       $dbw->delete( 'cu_changes', array( 
'cuc_id' => $ids ), $fname );
+                                       $dbw->delete( 'cu_changes', [ 'cuc_id' 
=> $ids ], $fname );
                                }
                        } );
                }
@@ -293,7 +293,7 @@
                global $wgUsePrivateIPs;
 
                if ( !strlen( $xff ) ) {
-                       return array( null, false );
+                       return [ null, false ];
                }
 
                # Get the list in the form of <PROXY N, ... PROXY 1, CLIENT>
@@ -339,7 +339,7 @@
                        break;
                }
 
-               return array( $client, $isSquidOnly );
+               return [ $client, $isSquidOnly ];
        }
 
        public static function onLoadExtensionSchemaUpdates( DatabaseUpdater 
$updater ) {
@@ -372,7 +372,7 @@
                        );
                } elseif ( $dbType === 'postgres' ) {
                        $updater->addExtensionUpdate(
-                               array( 'addPgField', 'cu_changes', 
'cuc_private', 'BYTEA' )
+                               [ 'addPgField', 'cu_changes', 'cuc_private', 
'BYTEA' ]
                        );
                }
 
@@ -421,19 +421,19 @@
                        $links[] = Linker::linkKnown(
                                SpecialPage::getTitleFor( 'CheckUser' ),
                                wfMessage( 'checkuser-contribs' )->escaped(),
-                               array(),
-                               array( 'user' => $nt->getText() )
+                               [],
+                               [ 'user' => $nt->getText() ]
                        );
                }
                if ( $wgUser->isAllowed( 'checkuser-log' ) ) {
                        $links[] = Linker::linkKnown(
                                SpecialPage::getTitleFor( 'CheckUserLog' ),
                                wfMessage( 'checkuser-contribs-log' 
)->escaped(),
-                               array(),
-                               array(
+                               [],
+                               [
                                        'cuSearchType' => 'target',
                                        'cuSearch' => $nt->getText()
-                               )
+                               ]
                        );
                }
                return true;
@@ -452,15 +452,15 @@
 
                $user = User::newFromName( (string)$block->getTarget(), false );
                if ( !$user->getId() ) {
-                       return array(); // user in an IP?
+                       return []; // user in an IP?
                }
 
-               $options = array( 'ORDER BY' => 'cuc_timestamp DESC' );
+               $options = [ 'ORDER BY' => 'cuc_timestamp DESC' ];
                $options['LIMIT'] = 1; // just the last IP used
 
                $res = $dbr->select( 'cu_changes',
-                       array( 'cuc_ip' ),
-                       array( 'cuc_user' => $user->getId() ),
+                       [ 'cuc_ip' ],
+                       [ 'cuc_user' => $user->getId() ],
                        __METHOD__,
                        $options
                );
@@ -479,9 +479,9 @@
        }
 
        public static function onUserMergeAccountFields( array &$updateFields ) 
{
-               $updateFields[] = array( 'cu_changes', 'cuc_user', 
'cuc_user_text' );
-               $updateFields[] = array( 'cu_log', 'cul_user', 'cul_user_text' 
);
-               $updateFields[] = array( 'cu_log', 'cul_target_id' );
+               $updateFields[] = [ 'cu_changes', 'cuc_user', 'cuc_user_text' ];
+               $updateFields[] = [ 'cu_log', 'cul_user', 'cul_user_text' ];
+               $updateFields[] = [ 'cu_log', 'cul_target_id' ];
 
                return true;
        }
@@ -500,7 +500,7 @@
                        'uniqueKey'    => 'cuc_id'
                ];
 
-               $renameUserSQL->tables['cu_log'] = array( 'cul_user_text', 
'cul_user' );
+               $renameUserSQL->tables['cu_log'] = [ 'cul_user_text', 
'cul_user' ];
 
                return true;
        }
diff --git a/CheckUser.php b/CheckUser.php
index ef94095..5532889 100644
--- a/CheckUser.php
+++ b/CheckUser.php
@@ -31,10 +31,10 @@
 $wgCheckUserForceSummary = false;
 
 /** Shortest CIDR limits that can be checked in any individual range check */
-$wgCheckUserCIDRLimit = array(
+$wgCheckUserCIDRLimit = [
        'IPv4' => 16,
        'IPv6' => 32,
-);
+];
 
 /**
  * Public key to encrypt private data that may need to be read later
diff --git a/CheckUserEncryptedData.php b/CheckUserEncryptedData.php
index 08b3334..04256ae 100644
--- a/CheckUserEncryptedData.php
+++ b/CheckUserEncryptedData.php
@@ -57,7 +57,7 @@
         * @param $publicKey String with ascii-armored block, or the return of 
openssl_get_publickey
         */
        private function encryptData( $data, $publicKey ) {
-               openssl_seal( $data, $encryptedString, $envelopeKeys, array( 
$publicKey ), $this->algName );
+               openssl_seal( $data, $encryptedString, $envelopeKeys, [ 
$publicKey ], $this->algName );
                $this->encString = $encryptedString;
                $this->envKeys = $envelopeKeys[0];
        }
diff --git a/CheckUserLogPager.php b/CheckUserLogPager.php
index caecd87..42e0a6a 100644
--- a/CheckUserLogPager.php
+++ b/CheckUserLogPager.php
@@ -72,11 +72,11 @@
        }
 
        function getQueryInfo() {
-               return array(
-                       'tables' => array( 'cu_log', 'user' ),
+               return [
+                       'tables' => [ 'cu_log', 'user' ],
                        'fields' => $this->selectFields(),
-                       'conds' => array_merge( $this->searchConds, array( 
'user_id = cul_user' ) )
-               );
+                       'conds' => array_merge( $this->searchConds, [ 'user_id 
= cul_user' ] )
+               ];
        }
 
        function getIndexField() {
@@ -84,10 +84,10 @@
        }
 
        function selectFields() {
-               return array(
+               return [
                        'cul_id', 'cul_timestamp', 'cul_user', 'cul_reason', 
'cul_type',
                        'cul_target_id', 'cul_target_text', 'user_name'
-               );
+               ];
        }
 
        /**
diff --git a/api/ApiQueryCheckUser.php b/api/ApiQueryCheckUser.php
index 66a4311..a432323 100644
--- a/api/ApiQueryCheckUser.php
+++ b/api/ApiQueryCheckUser.php
@@ -14,9 +14,9 @@
                $db = $this->getDB();
                $params = $this->extractRequestParams();
 
-               list( $request, $target, $reason, $timecond, $limit, $xff ) = 
array(
+               list( $request, $target, $reason, $timecond, $limit, $xff ) = [
                        $params['request'], $params['target'], 
$params['reason'],
-                       $params['timecond'], $params['limit'], $params['xff'] );
+                       $params['timecond'], $params['limit'], $params['xff'] ];
 
                if ( !$this->getUser()->isAllowed( 'checkuser' ) ) {
                        $this->dieUsage( 'You need the checkuser right', 
'permissionerror' );
@@ -44,12 +44,12 @@
                                        $this->dieUsage( 'Target user does not 
exist', 'nosuchuser' );
                                }
 
-                               $this->addFields( array( 'cuc_timestamp', 
'cuc_ip', 'cuc_xff' ) );
+                               $this->addFields( [ 'cuc_timestamp', 'cuc_ip', 
'cuc_xff' ] );
                                $this->addWhereFld( 'cuc_user_text', $target );
                                $res = $this->select( __METHOD__ );
                                $result = $this->getResult();
 
-                               $ips = array();
+                               $ips = [];
                                foreach ( $res as $row ) {
                                        $timestamp = wfTimestamp( TS_ISO_8601, 
$row->cuc_timestamp );
                                        $ip = strval( $row->cuc_ip );
@@ -63,17 +63,17 @@
                                        }
                                }
 
-                               $resultIPs = array();
+                               $resultIPs = [];
                                foreach ( $ips as $ip => $data ) {
                                        $data['address'] = $ip;
                                        $resultIPs[] = $data;
                                }
 
                                CheckUser::addLogEntry( 'userips', 'user', 
$target, $reason, $user_id );
-                               $result->addValue( array(
-                                       'query', $this->getModuleName() ), 
'userips', $resultIPs );
-                               $result->addIndexedTagName( array(
-                                       'query', $this->getModuleName(), 
'userips' ), 'ip' );
+                               $result->addValue( [
+                                       'query', $this->getModuleName() ], 
'userips', $resultIPs );
+                               $result->addIndexedTagName( [
+                                       'query', $this->getModuleName(), 
'userips' ], 'ip' );
                                break;
 
                        case 'edits':
@@ -83,7 +83,7 @@
                                                $this->dieUsage( 'IP or range 
is invalid', 'invalidip' );
                                        }
                                        $this->addWhere( $cond );
-                                       $log_type = array();
+                                       $log_type = [];
                                        if ( isset( $xff ) ) {
                                                $log_type[] = 'ipedits-xff';
                                        } else {
@@ -96,27 +96,27 @@
                                                $this->dieUsage( 'Target user 
does not exist', 'nosuchuser' );
                                        }
                                        $this->addWhereFld( 'cuc_user_text', 
$target );
-                                       $log_type = array( 'useredits', 'user' 
);
+                                       $log_type = [ 'useredits', 'user' ];
                                }
 
-                               $this->addFields( array(
+                               $this->addFields( [
                                        'cuc_namespace', 'cuc_title', 
'cuc_user_text', 'cuc_actiontext',
                                        'cuc_comment', 'cuc_minor', 
'cuc_timestamp', 'cuc_ip', 'cuc_xff', 'cuc_agent'
-                               ) );
+                               ] );
 
                                $res = $this->select( __METHOD__ );
                                $result = $this->getResult();
 
-                               $edits = array();
+                               $edits = [];
                                foreach ( $res as $row ) {
-                                       $edit = array(
+                                       $edit = [
                                                'timestamp' => wfTimestamp( 
TS_ISO_8601, $row->cuc_timestamp ),
                                                'ns'        => intval( 
$row->cuc_namespace ),
                                                'title'     => $row->cuc_title,
                                                'user'      => 
$row->cuc_user_text,
                                                'ip'        => $row->cuc_ip,
                                                'agent'     => $row->cuc_agent,
-                                       );
+                                       ];
                                        if ( $row->cuc_actiontext ) {
                                                $edit['summary'] = 
$row->cuc_actiontext;
                                        } elseif ( $row->cuc_comment ) {
@@ -133,10 +133,10 @@
 
                                CheckUser::addLogEntry( $log_type[0], 
$log_type[1],
                                        $target, $reason, isset( $user_id ) ? 
$user_id : '0' );
-                               $result->addValue( array(
-                                       'query', $this->getModuleName() ), 
'edits', $edits );
-                               $result->addIndexedTagName( array(
-                                       'query', $this->getModuleName(), 
'edits' ), 'action' );
+                               $result->addValue( [
+                                       'query', $this->getModuleName() ], 
'edits', $edits );
+                               $result->addIndexedTagName( [
+                                       'query', $this->getModuleName(), 
'edits' ], 'action' );
                                break;
 
                        case 'ipusers':
@@ -151,13 +151,13 @@
                                        $this->dieUsage( 'IP or range is 
invalid', 'invalidip' );
                                }
 
-                               $this->addFields( array(
-                                       'cuc_user_text', 'cuc_timestamp', 
'cuc_ip', 'cuc_agent' ) );
+                               $this->addFields( [
+                                       'cuc_user_text', 'cuc_timestamp', 
'cuc_ip', 'cuc_agent' ] );
 
                                $res = $this->select( __METHOD__ );
                                $result = $this->getResult();
 
-                               $users = array();
+                               $users = [];
                                foreach ( $res as $row ) {
                                        $user = $row->cuc_user_text;
                                        $ip = $row->cuc_ip;
@@ -180,7 +180,7 @@
                                        }
                                }
 
-                               $resultUsers = array();
+                               $resultUsers = [];
                                foreach ( $users as $userName => $userData ) {
                                        $userData['name'] = $userName;
                                        $result->setIndexedTagName( 
$userData['ips'], 'ip' );
@@ -190,10 +190,10 @@
                                }
 
                                CheckUser::addLogEntry( $log_type, 'ip', 
$target, $reason );
-                               $result->addValue( array(
-                                       'query', $this->getModuleName() ), 
'ipusers', $resultUsers );
-                               $result->addIndexedTagName( array(
-                                       'query', $this->getModuleName(), 
'ipusers' ), 'user' );
+                               $result->addValue( [
+                                       'query', $this->getModuleName() ], 
'ipusers', $resultUsers );
+                               $result->addIndexedTagName( [
+                                       'query', $this->getModuleName(), 
'ipusers' ], 'user' );
                                break;
 
                        default:
@@ -210,43 +210,43 @@
        }
 
        public function getAllowedParams() {
-               return array(
-                       'request'  => array(
+               return [
+                       'request'  => [
                                ApiBase::PARAM_REQUIRED => true,
-                               ApiBase::PARAM_TYPE => array(
+                               ApiBase::PARAM_TYPE => [
                                        'userips',
                                        'edits',
                                        'ipusers',
-                               )
-                       ),
-                       'target'   => array(
+                               ]
+                       ],
+                       'target'   => [
                                ApiBase::PARAM_REQUIRED => true,
-                       ),
+                       ],
                        'reason'   => null,
-                       'limit'    => array(
+                       'limit'    => [
                                ApiBase::PARAM_DFLT => 1000,
                                ApiBase::PARAM_TYPE => 'limit',
                                ApiBase::PARAM_MIN  => 1,
                                ApiBase::PARAM_MAX  => 500,
                                ApiBase::PARAM_MAX2 => 5000,
-                       ),
-                       'timecond' => array(
+                       ],
+                       'timecond' => [
                                ApiBase::PARAM_DFLT => '-2 weeks'
-                       ),
+                       ],
                        'xff'      => null,
-               );
+               ];
        }
 
        /**
         * @see ApiBase::getExamplesMessages()
         */
        protected function getExamplesMessages() {
-               return array(
+               return [
                        
'action=query&list=checkuser&curequest=userips&cutarget=Jimbo_Wales'
                                => 'apihelp-query+checkuser-example-1',
                        
'action=query&list=checkuser&curequest=edits&cutarget=127.0.0.1/16&xff=1&cureason=Some_check'
                                => 'apihelp-query+checkuser-example-2',
-               );
+               ];
        }
 
        public function getHelpUrls() {
diff --git a/api/ApiQueryCheckUserLog.php b/api/ApiQueryCheckUserLog.php
index ae9c383..f308bf6 100644
--- a/api/ApiQueryCheckUserLog.php
+++ b/api/ApiQueryCheckUserLog.php
@@ -22,12 +22,12 @@
                $this->addTables( 'cu_log' );
                $this->addOption( 'LIMIT', $limit + 1 );
                $this->addTimestampWhereRange( 'cul_timestamp', $dir, 
$params['from'], $params['to'] );
-               $this->addFields( array(
-                       'cul_id', 'cul_timestamp', 'cul_user_text', 
'cul_reason', 'cul_type', 'cul_target_text' ) );
+               $this->addFields( [
+                       'cul_id', 'cul_timestamp', 'cul_user_text', 
'cul_reason', 'cul_type', 'cul_target_text' ] );
 
                // Order by both timestamp and id
                $order = ( $dir === 'newer' ? '' : ' DESC' );
-               $this->addOption( 'ORDER BY', array( 'cul_timestamp' . $order, 
'cul_id' . $order ) );
+               $this->addOption( 'ORDER BY', [ 'cul_timestamp' . $order, 
'cul_id' . $order ] );
 
                if ( isset( $params['user'] ) ) {
                        $this->addWhereFld( 'cul_user_text', $params['user'] );
@@ -67,64 +67,64 @@
                                $this->setContinueEnumParameter( 'continue', 
$makeContinue( $row ) );
                                break;
                        }
-                       $log = array(
+                       $log = [
                                'timestamp' => wfTimestamp( TS_ISO_8601, 
$row->cul_timestamp ),
                                'checkuser' => $row->cul_user_text,
                                'type'      => $row->cul_type,
                                'reason'    => $row->cul_reason,
                                'target'    => $row->cul_target_text,
-                       );
-                       $fit = $result->addValue( array( 'query', 
$this->getModuleName(), 'entries' ), null, $log );
+                       ];
+                       $fit = $result->addValue( [ 'query', 
$this->getModuleName(), 'entries' ], null, $log );
                        if ( !$fit ) {
                                $this->setContinueEnumParameter( 'continue', 
$makeContinue( $row ) );
                                break;
                        }
                }
 
-               $result->addIndexedTagName( array( 'query', 
$this->getModuleName(), 'entries' ), 'entry' );
+               $result->addIndexedTagName( [ 'query', $this->getModuleName(), 
'entries' ], 'entry' );
        }
 
        public function getAllowedParams() {
-               return array(
+               return [
                        'user'   => null,
                        'target' => null,
-                       'limit'  => array(
+                       'limit'  => [
                                ApiBase::PARAM_DFLT => 10,
                                ApiBase::PARAM_TYPE => 'limit',
                                ApiBase::PARAM_MIN  => 1,
                                ApiBase::PARAM_MAX  => ApiBase::LIMIT_BIG1,
                                ApiBase::PARAM_MAX2 => ApiBase::LIMIT_BIG2,
-                       ),
-                       'dir' => array(
+                       ],
+                       'dir' => [
                                ApiBase::PARAM_DFLT => 'older',
-                               ApiBase::PARAM_TYPE => array(
+                               ApiBase::PARAM_TYPE => [
                                        'newer',
                                        'older'
-                               ),
+                               ],
                                ApiBase::PARAM_HELP_MSG => 
'api-help-param-direction',
-                       ),
-                       'from'  => array(
+                       ],
+                       'from'  => [
                                ApiBase::PARAM_TYPE => 'timestamp',
-                       ),
-                       'to'    => array(
+                       ],
+                       'to'    => [
                                ApiBase::PARAM_TYPE => 'timestamp',
-                       ),
-                       'continue' => array(
+                       ],
+                       'continue' => [
                                ApiBase::PARAM_HELP_MSG => 
'api-help-param-continue',
-                       ),
-               );
+                       ],
+               ];
        }
 
        /**
         * @see ApiBase::getExamplesMessages()
         */
        protected function getExamplesMessages() {
-               return array(
+               return [
                        
'action=query&list=checkuserlog&culuser=Example&cullimit=25'
                                => 'apihelp-query+checkuserlog-example-1',
                        
'action=query&list=checkuserlog&cultarget=192.0.2.0/24&culfrom=2011-10-15T23:00:00Z'
                                => 'apihelp-query+checkuserlog-example-2',
-               );
+               ];
        }
 
        public function getHelpUrls() {
diff --git a/maintenance/importCheckUserLogs.php 
b/maintenance/importCheckUserLogs.php
index 14eed61..bd2a317 100644
--- a/maintenance/importCheckUserLogs.php
+++ b/maintenance/importCheckUserLogs.php
@@ -49,24 +49,24 @@
                // Strip nulls due to NFS write collisions
                $line = str_replace( "\0", '', $line );
 
-               $regexes = array(
+               $regexes = [
                        'ipedits-xff' => "!^<li>$rxTimestamp, $rxUser got edits 
for XFF $rxTarget on $rxWiki$rxReason</li>!",
                        'ipedits'     => "!^<li>$rxTimestamp, $rxUser got edits 
for" . " $rxTarget on $rxWiki$rxReason</li>!",
                        'ipusers-xff' => "!^<li>$rxTimestamp, $rxUser got users 
for XFF $rxTarget on $rxWiki$rxReason</li>!",
                        'ipusers'     => "!^<li>$rxTimestamp, $rxUser got users 
for" . " $rxTarget on $rxWiki$rxReason</li>!",
                        'userips'     => "!^<li>$rxTimestamp, $rxUser got IPs 
for" .   " $rxTarget on $rxWiki$rxReason</li>!",
-               );
+               ];
 
                foreach ( $regexes as $type => $regex ) {
                        $m = false;
                        if ( preg_match( $regex, $line, $m ) ) {
-                               $data = array(
+                               $data = [
                                        'timestamp' => strtotime( 
$m['timestamp'] ),
                                        'user' => $m['user'],
                                        'reason' => isset( $m['reason'] ) ? 
$m['reason'] : '',
                                        'type' => $type,
                                        'wiki' => $m['wiki'],
-                                       'target' => $m['target'] );
+                                       'target' => $m['target'] ];
 
                                return $data;
                        }
@@ -107,7 +107,7 @@
 
                                if ( !$this->hasOption( 'dry-run' ) ) {
                                        $dbw = $this->getDB( DB_MASTER );
-                                       $fields = array(
+                                       $fields = [
                                                'cul_id' => 
$dbw->nextSequenceValue( 'cu_log_cul_id_seq' ),
                                                'cul_timestamp' => 
$dbw->timestamp( $data['timestamp'] ),
                                                'cul_user' => $user->getID(),
@@ -118,7 +118,7 @@
                                                'cul_target_text' => 
$data['target'],
                                                'cul_target_hex' => $hex,
                                                'cul_range_start' => $start,
-                                               'cul_range_end' => $end );
+                                               'cul_range_end' => $end ];
 
                                        $dbw->insert( 'cu_log', $fields, 
__METHOD__ );
                                }
diff --git a/maintenance/populateCheckUserTable.php 
b/maintenance/populateCheckUserTable.php
index edca88b..48f8d44 100644
--- a/maintenance/populateCheckUserTable.php
+++ b/maintenance/populateCheckUserTable.php
@@ -41,7 +41,7 @@
                        $encCutoff = $db->addQuotes( $db->timestamp( $cutoff ) 
);
                        $db->delete(
                                'cu_changes',
-                               array( "cuc_timestamp < $encCutoff" ),
+                               [ "cuc_timestamp < $encCutoff" ],
                                __METHOD__
                        );
                        $cutoffCond = "AND rc_timestamp < $encCutoff";
@@ -62,9 +62,9 @@
                        $this->output( "...migrating rc_id from $blockStart to 
$blockEnd\n" );
                        $cond = "rc_id BETWEEN $blockStart AND $blockEnd 
$cutoffCond";
                        $res = $db->select( 'recentchanges', '*', $cond, 
__METHOD__ );
-                       $batch = array();
+                       $batch = [];
                        foreach ( $res as $row ) {
-                               $batch[] = array(
+                               $batch[] = [
                                        'cuc_timestamp' => $row->rc_timestamp,
                                        'cuc_user' => $row->rc_user,
                                        'cuc_user_text' => $row->rc_user_text,
@@ -78,7 +78,7 @@
                                        'cuc_type' => $row->rc_type,
                                        'cuc_ip' => $row->rc_ip,
                                        'cuc_ip_hex' => IP::toHex( $row->rc_ip 
),
-                               );
+                               ];
                        }
                        if ( count( $batch ) ) {
                                $db->insert( 'cu_changes', $batch, __METHOD__ );
diff --git a/maintenance/purgeOldData.php b/maintenance/purgeOldData.php
index e164c18..e39cd2b 100644
--- a/maintenance/purgeOldData.php
+++ b/maintenance/purgeOldData.php
@@ -40,7 +40,7 @@
                        $res = $dbw->select( $table, $ts_column,
                                $expiredCond,
                                __METHOD__,
-                               array( 'ORDER BY' => "$ts_column ASC", 'LIMIT' 
=> $this->mBatchSize )
+                               [ 'ORDER BY' => "$ts_column ASC", 'LIMIT' => 
$this->mBatchSize ]
                        );
                        if ( !$res->numRows() ) {
                                break; // all cleared
@@ -54,7 +54,7 @@
                        // Do the actual delete...
                        $this->beginTransaction( $dbw, __METHOD__ );
                        $dbw->delete( $table,
-                               array( "$ts_column BETWEEN $blockStart AND 
$blockEnd" ), __METHOD__ );
+                               [ "$ts_column BETWEEN $blockStart AND 
$blockEnd" ], __METHOD__ );
                        $count += $dbw->affectedRows();
                        $this->commitTransaction( $dbw, __METHOD__ );
 
diff --git a/phpcs.xml b/phpcs.xml
index 4fedfb5..2f7edc8 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -2,9 +2,6 @@
 <ruleset>
        <rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki"/>
        <file>.</file>
-       <rule ref="Generic.Arrays.DisallowLongArraySyntax.Found">
-               <severity>0</severity>
-       </rule>
        <rule ref="Generic.Files.LineLength.TooLong">
                <severity>0</severity>
        </rule>
diff --git a/specials/SpecialCheckUser.php b/specials/SpecialCheckUser.php
index 3dd0bbd..54d823e 100644
--- a/specials/SpecialCheckUser.php
+++ b/specials/SpecialCheckUser.php
@@ -45,14 +45,14 @@
                $talkTag = $request->getBool( 'usettag' ) ?
                        trim( $request->getVal( 'talktag' ) ) : '';
 
-               $blockParams = array(
+               $blockParams = [
                        'reason' => $blockreason,
                        'talk' => $disableUserTalk,
                        'email' => $disableEmail,
-               );
+               ];
 
                $ip = $name = $xff = '';
-               $m = array();
+               $m = [];
                if ( IP::isIPAddress( $user ) ) {
                        // A single IP address or an IP range
                        $ip = IP::sanitizeIP( $user );
@@ -132,28 +132,28 @@
                        $encuserips = 1;
                }
 
-               $form = Xml::openElement( 'form', array( 'action' => $action,
-                       'name' => 'checkuserform', 'id' => 'checkuserform', 
'method' => 'post' ) );
+               $form = Xml::openElement( 'form', [ 'action' => $action,
+                       'name' => 'checkuserform', 'id' => 'checkuserform', 
'method' => 'post' ] );
                $form .= '<fieldset><legend>' . $this->msg( 'checkuser-query' 
)->escaped() . '</legend>';
-               $form .= Xml::openElement( 'table', array( 'style' => 
'border:0' ) );
+               $form .= Xml::openElement( 'table', [ 'style' => 'border:0' ] );
                $form .= '<tr>';
                $form .= '<td>' . $this->msg( 'checkuser-target' )->escaped() . 
'</td>';
                // User field should fit things like 
"2001:0db8:85a3:08d3:1319:8a2e:0370:7344/100/xff"
-               $form .= '<td>' . Xml::input( 'user', 46, $user, array( 'id' => 
'checktarget' ) );
+               $form .= '<td>' . Xml::input( 'user', 46, $user, [ 'id' => 
'checktarget' ] );
                $form .= '&#160;' . $this->getPeriodMenu( $period ) . '</td>';
                $form .= '</tr><tr>';
                $form .= '<td></td>';
-               $form .= Xml::openElement( 'td', array( 'class' => 
'checkuserradios' ) );
-               $form .= Xml::openElement( 'table', array( 'style' => 
'border:0' ) );
+               $form .= Xml::openElement( 'td', [ 'class' => 'checkuserradios' 
] );
+               $form .= Xml::openElement( 'table', [ 'style' => 'border:0' ] );
                $form .= '<tr>';
                $form .= '<td>' .
-                       Xml::radio( 'checktype', 'subuserips', $encuserips, 
array( 'id' => 'subuserips' ) );
+                       Xml::radio( 'checktype', 'subuserips', $encuserips, [ 
'id' => 'subuserips' ] );
                $form .= ' ' . Xml::label( $this->msg( 'checkuser-ips' 
)->text(), 'subuserips' ) . '</td>';
                $form .= '<td>' .
-                       Xml::radio( 'checktype', 'subedits', $encedits, array( 
'id' => 'subedits' ) );
+                       Xml::radio( 'checktype', 'subedits', $encedits, [ 'id' 
=> 'subedits' ] );
                $form .= ' ' . Xml::label( $this->msg( 'checkuser-edits' 
)->text(), 'subedits' ) . '</td>';
                $form .= '<td>' .
-                       Xml::radio( 'checktype', 'subipusers', $encipusers, 
array( 'id' => 'subipusers' ) );
+                       Xml::radio( 'checktype', 'subipusers', $encipusers, [ 
'id' => 'subipusers' ] );
                $form .= ' ' . Xml::label( $this->msg( 'checkuser-users' 
)->text(), 'subipusers' ) . '</td>';
                $form .= '</tr>';
                $form .= Xml::closeElement( 'table' );
@@ -161,9 +161,9 @@
                $form .= '</tr><tr>';
                $form .= '<td>' . $this->msg( 'checkuser-reason' )->escaped() . 
'</td>';
                $form .= '<td>' . Xml::input( 'reason', 46, $reason,
-                       array( 'maxlength' => '150', 'id' => 'checkreason' ) );
+                       [ 'maxlength' => '150', 'id' => 'checkreason' ] );
                $form .= '&#160; &#160;' . Xml::submitButton( $this->msg( 
'checkuser-check' )->text(),
-                       array( 'id' => 'checkusersubmit', 'name' => 
'checkusersubmit' ) ) . '</td>';
+                       [ 'id' => 'checkusersubmit', 'name' => 
'checkusersubmit' ] ) . '</td>';
                $form .= '</tr>';
                $form .= Xml::closeElement( 'table' );
                $form .= '</fieldset>';
@@ -182,7 +182,7 @@
                $s = '<label for="period">' . $this->msg( 'checkuser-period' 
)->escaped() . '</label>&#160;';
                $s .= Xml::openElement(
                        'select',
-                       array( 'name' => 'period', 'id' => 'period', 'style' => 
'margin-top:.2em;' )
+                       [ 'name' => 'period', 'id' => 'period', 'style' => 
'margin-top:.2em;' ]
                );
                $s .= Xml::option( $this->msg( 'checkuser-week-1' )->text(), 7, 
$selected === 7 );
                $s .= Xml::option( $this->msg( 'checkuser-week-2' )->text(), 
14, $selected === 14 );
@@ -200,7 +200,7 @@
                        '<legend>' . $this->msg( 'checkuser-cidr-label' 
)->escaped() . '</legend>';
                $s .= '<textarea id="mw-checkuser-iplist" dir="ltr" rows="5" 
cols="50"></textarea><br />';
                $s .= $this->msg( 'checkuser-cidr-res' )->escaped() . '&#160;' .
-                       Xml::input( 'mw-checkuser-cidr-res', 35, '', array( 
'id' => 'mw-checkuser-cidr-res' ) ) .
+                       Xml::input( 'mw-checkuser-cidr-res', 35, '', [ 'id' => 
'mw-checkuser-cidr-res' ] ) .
                        '&#160;<strong id="mw-checkuser-ipnote"></strong>';
                $s .= '</fieldset>';
                $this->getOutput()->addHTML( $s );
@@ -221,7 +221,7 @@
         */
        protected function preCacheMessages() {
                if ( $this->message === null ) {
-                       $msgKeys = array( 'diff', 'hist', 'minoreditletter', 
'newpageletter', 'blocklink', 'log' );
+                       $msgKeys = [ 'diff', 'hist', 'minoreditletter', 
'newpageletter', 'blocklink', 'log' ];
                        foreach ( $msgKeys as $msg ) {
                                $this->message[$msg] = $this->msg( $msg 
)->escaped();
                        }
@@ -278,7 +278,7 @@
                global $wgBlockAllowsUTEdit;
 
                $currentUser = $this->getUser();
-               $safeUsers = array();
+               $safeUsers = [];
                foreach ( $users as $name ) {
                        $u = User::newFromName( $name, false );
                        // Do some checks to make sure we can block this user 
first
@@ -319,7 +319,7 @@
                        $status = $block->insert();
 
                        // Prepare log parameters for the block
-                       $logParams = array();
+                       $logParams = [];
                        $logParams['5::duration'] = $expirestr;
                        $logParams['6::flags'] = self::userBlockLogFlags( 
$isIP, $blockParams );
 
@@ -328,8 +328,8 @@
                        $logEntry->setComment( $blockParams['reason'] );
                        $logEntry->setPerformer( $currentUser );
                        $logEntry->setParameters( $logParams );
-                       $blockIds = array_merge( array( $status['id'] ), 
$status['autoIds'] );
-                       $logEntry->setRelations( array( 'ipb_id' => $blockIds ) 
);
+                       $blockIds = array_merge( [ $status['id'] ], 
$status['autoIds'] );
+                       $logEntry->setRelations( [ 'ipb_id' => $blockIds ] );
                        $logEntry->publish( $logEntry->insert() );
 
                        // Tag user page and user talk page
@@ -349,7 +349,7 @@
         */
        protected static function userBlockLogFlags( $anonOnly, array 
$blockParams ) {
                global $wgBlockAllowsUTEdit;
-               $flags = array();
+               $flags = [];
 
                if ( $anonOnly ) {
                        $flags[] = 'anononly';
@@ -403,22 +403,22 @@
                        if ( $user_id ) {
                                $revEdit = $dbr->selectField( 'revision',
                                        'rev_timestamp',
-                                       array( 'rev_user' => $user_id ),
+                                       [ 'rev_user' => $user_id ],
                                        __METHOD__,
-                                       array( 'ORDER BY' => 'rev_timestamp 
DESC' )
+                                       [ 'ORDER BY' => 'rev_timestamp DESC' ]
                                );
                                $logEdit = $dbr->selectField( 'logging',
                                        'log_timestamp',
-                                       array( 'log_user' => $user_id ),
+                                       [ 'log_user' => $user_id ],
                                        __METHOD__,
-                                       array( 'ORDER BY' => 'log_timestamp 
DESC' )
+                                       [ 'ORDER BY' => 'log_timestamp DESC' ]
                                );
                        } else {
                                $revEdit = $dbr->selectField( 'revision',
                                        'rev_timestamp',
-                                       array( 'rev_user_text' => $userName ),
+                                       [ 'rev_user_text' => $userName ],
                                        __METHOD__,
-                                       array( 'ORDER BY' => 'rev_timestamp 
DESC' )
+                                       [ 'ORDER BY' => 'rev_timestamp DESC' ]
                                );
                                $logEdit = false; // no log_user_text index
                        }
@@ -474,27 +474,27 @@
 
                $ret = $dbr->select(
                        'cu_changes',
-                       array(
+                       [
                                'cuc_ip',
                                'cuc_ip_hex',
                                'COUNT(*) AS count',
                                'MIN(cuc_timestamp) AS first',
                                'MAX(cuc_timestamp) AS last',
-                       ),
-                       array( 'cuc_user' => $user_id, $time_conds ),
+                       ],
+                       [ 'cuc_user' => $user_id, $time_conds ],
                        __METHOD__,
-                       array(
+                       [
                                'ORDER BY' => 'last DESC',
                                'GROUP BY' => 'cuc_ip,cuc_ip_hex',
                                'LIMIT' => 5001,
                                'USE INDEX' => 'cuc_user_ip_time',
-                       )
+                       ]
                );
 
                if ( !$dbr->numRows( $ret ) ) {
                        $s = $this->noMatchesMessage( $user ) . "\n";
                } else {
-                       $ips_edits = array();
+                       $ips_edits = [];
                        $counter = 0;
                        foreach ( $ret as $row ) {
                                if ( $counter >= 5000 ) {
@@ -516,10 +516,10 @@
                        foreach ( $ips_edits as $ip => $edits ) {
                                $s .= '<li>';
                                $s .= $this->getSelfLink( $ip,
-                                       array(
+                                       [
                                                'user' => $ip,
                                                'reason' => $reason,
-                                       )
+                                       ]
                                );
                                $s .= ' ' . $this->msg( 'parentheses' 
)->rawParams(
                                                Linker::linkKnown(
@@ -533,12 +533,12 @@
                                // If we get some results, it helps to know if 
the IP in general
                                // has a lot more edits, e.g. "tip of the 
iceberg"...
                                $ipedits = $dbr->estimateRowCount( 
'cu_changes', '*',
-                                       array( 'cuc_ip_hex' => $ips_hex[$ip], 
$time_conds ),
+                                       [ 'cuc_ip_hex' => $ips_hex[$ip], 
$time_conds ],
                                        __METHOD__ );
                                // If small enough, get a more accurate count
                                if ( $ipedits <= 1000 ) {
                                        $ipedits = $dbr->selectField( 
'cu_changes', 'COUNT(*)',
-                                               array( 'cuc_ip_hex' => 
$ips_hex[$ip], $time_conds ),
+                                               [ 'cuc_ip_hex' => 
$ips_hex[$ip], $time_conds ],
                                                __METHOD__ );
                                }
                                if ( $ipedits > $ips_edits[$ip] ) {
@@ -578,19 +578,19 @@
                        $ret = Linker::linkKnown(
                                SpecialPage::getTitleFor( 'BlockList' ),
                                $this->msg( 'checkuser-blocked' )->escaped(),
-                               array(),
-                               array( 'wpTarget' => "#{$block->getId()}" )
+                               [],
+                               [ 'wpTarget' => "#{$block->getId()}" ]
                        );
                } else {
                        $userPage = Title::makeTitle( NS_USER, 
$block->getTarget() );
                        $ret = Linker::linkKnown(
                                SpecialPage::getTitleFor( 'Log' ),
                                $this->msg( 'checkuser-blocked' )->escaped(),
-                               array(),
-                               array(
+                               [],
+                               [
                                        'type' => 'block',
                                        'page' => $userPage->getPrefixedText()
-                               )
+                               ]
                        );
                }
 
@@ -638,14 +638,14 @@
                        // Quick index check only OK if no time constraint
                        if ( $period ) {
                                $rangecount = $dbr->selectField( 'cu_changes', 
'COUNT(*)',
-                                       array( $ip_conds, $time_conds ),
+                                       [ $ip_conds, $time_conds ],
                                        __METHOD__,
-                                       array( 'USE INDEX' => $index ) );
+                                       [ 'USE INDEX' => $index ] );
                        } else {
                                $rangecount = $dbr->estimateRowCount( 
'cu_changes', '*',
-                                       array( $ip_conds ),
+                                       [ $ip_conds ],
                                        __METHOD__,
-                                       array( 'USE INDEX' => $index ) );
+                                       [ 'USE INDEX' => $index ] );
                        }
                        // Sorting might take some time...make sure it is there
                        wfSuppressWarnings();
@@ -657,20 +657,20 @@
                if ( isset( $rangecount ) && $rangecount > 5000 ) {
                        $ret = $dbr->select(
                                'cu_changes',
-                               array(
+                               [
                                        'cuc_ip_hex',
                                        'COUNT(*) AS count',
                                        'MIN(cuc_timestamp) AS first',
                                        'MAX(cuc_timestamp) AS last'
-                               ),
-                               array( $ip_conds, $time_conds ),
+                               ],
+                               [ $ip_conds, $time_conds ],
                                __METHOD__,
-                               array(
+                               [
                                        'GROUP BY' => 'cuc_ip_hex',
                                        'ORDER BY' => 'cuc_ip_hex',
                                        'LIMIT' => 5001,
                                        'USE INDEX' => $index,
-                               )
+                               ]
                        );
                        // List out each IP that has edits
                        $s = $this->msg( 'checkuser-too-many' )->parseAsBlock();
@@ -689,11 +689,11 @@
                                }
                                $s .= '<li>';
                                $s .= $this->getSelfLink( $ip,
-                                       array(
+                                       [
                                                'user' => $ip,
                                                'reason' => $reason,
                                                'checktype' => 'subipusers'
-                                       )
+                                       ]
                                );
                                $s .= ' ' . $this->getTimeRangeString( 
$row->first, $row->last ) . ' ';
                                $s .= ' [<strong>' . $row->count . 
"</strong>]</li>\n";
@@ -713,18 +713,18 @@
 
                $ret = $dbr->select(
                        'cu_changes',
-                       array(
+                       [
                                'cuc_namespace', 'cuc_title', 'cuc_user', 
'cuc_user_text', 'cuc_comment', 'cuc_actiontext',
                                'cuc_timestamp', 'cuc_minor', 'cuc_page_id', 
'cuc_type', 'cuc_this_oldid',
                                'cuc_last_oldid', 'cuc_ip', 'cuc_xff', 
'cuc_agent'
-                       ),
-                       array( $ip_conds, $time_conds ),
+                       ],
+                       [ $ip_conds, $time_conds ],
                        __METHOD__,
-                       array(
+                       [
                                'ORDER BY' => 'cuc_timestamp DESC',
                                'LIMIT' => 5001,
                                'USE INDEX' => $index,
-                       )
+                       ]
                );
 
                if ( !$dbr->numRows( $ret ) ) {
@@ -816,14 +816,14 @@
                // If it is, sort by IP,time to avoid the filesort.
                if ( $period ) {
                        $count = $dbr->selectField( 'cu_changes', 'COUNT(*)',
-                               array( $user_cond, $time_conds ),
+                               [ $user_cond, $time_conds ],
                                __METHOD__,
-                               array( 'USE INDEX' => 'cuc_user_ip_time' ) );
+                               [ 'USE INDEX' => 'cuc_user_ip_time' ] );
                } else {
                        $count = $dbr->estimateRowCount( 'cu_changes', '*',
-                               array( $user_cond, $time_conds ),
+                               [ $user_cond, $time_conds ],
                                __METHOD__,
-                               array( 'USE INDEX' => 'cuc_user_ip_time' ) );
+                               [ 'USE INDEX' => 'cuc_user_ip_time' ] );
                }
                // Cache common messages
                $this->preCacheMessages();
@@ -834,13 +834,13 @@
                        $ret = $dbr->select(
                                'cu_changes',
                                '*',
-                               array( $user_cond, $time_conds ),
+                               [ $user_cond, $time_conds ],
                                __METHOD__,
-                               array(
+                               [
                                        'ORDER BY' => 'cuc_ip ASC, 
cuc_timestamp DESC',
                                        'LIMIT' => 5000,
                                        'USE INDEX' => 'cuc_user_ip_time'
-                               )
+                               ]
                        );
                        // Try to optimize this query
                        $this->doLinkCache( $ret );
@@ -875,13 +875,13 @@
                $ret = $dbr->select(
                        'cu_changes',
                        '*',
-                       array( $user_cond, $time_conds ),
+                       [ $user_cond, $time_conds ],
                        __METHOD__,
-                       array(
+                       [
                                'ORDER BY' => 'cuc_timestamp DESC',
                                'LIMIT' => 5000,
                                'USE INDEX' => 'cuc_user_ip_time'
-                       )
+                       ]
                );
                if ( !$dbr->numRows( $ret ) ) {
                        $s = $this->noMatchesMessage( $user ) . "\n";
@@ -936,14 +936,14 @@
                        // Quick index check only OK if no time constraint
                        if ( $period ) {
                                $rangecount = $dbr->selectField( 'cu_changes', 
'COUNT(*)',
-                                       array( $ip_conds, $time_conds ),
+                                       [ $ip_conds, $time_conds ],
                                        __METHOD__,
-                                       array( 'USE INDEX' => $index ) );
+                                       [ 'USE INDEX' => $index ] );
                        } else {
                                $rangecount = $dbr->estimateRowCount( 
'cu_changes', '*',
-                                       array( $ip_conds ),
+                                       [ $ip_conds ],
                                        __METHOD__,
-                                       array( 'USE INDEX' => $index ) );
+                                       [ 'USE INDEX' => $index ] );
                        }
                        // Sorting might take some time...make sure it is there
                        wfSuppressWarnings();
@@ -954,18 +954,18 @@
                if ( isset( $rangecount ) && $rangecount > 10000 ) {
                        $ret = $dbr->select(
                                'cu_changes',
-                               array(
+                               [
                                        'cuc_ip_hex', 'COUNT(*) AS count',
                                        'MIN(cuc_timestamp) AS first', 
'MAX(cuc_timestamp) AS last'
-                               ),
-                               array( $ip_conds, $time_conds ),
+                               ],
+                               [ $ip_conds, $time_conds ],
                                __METHOD__,
-                               array(
+                               [
                                        'GROUP BY' => 'cuc_ip_hex',
                                        'ORDER BY' => 'cuc_ip_hex',
                                        'LIMIT' => 5001,
                                        'USE INDEX' => $index,
-                               )
+                               ]
                        );
                        // List out each IP that has edits
                        $s = '<h5>' . $this->msg( 'checkuser-too-many' 
)->escaped() . '</h5>';
@@ -985,11 +985,11 @@
                                }
                                $s .= '<li>';
                                $s .= $this->getSelfLink( $ip,
-                                       array(
+                                       [
                                                'user' => $ip,
                                                'reason' => $reason,
                                                'checktype' => 'subipusers'
-                                       )
+                                       ]
                                );
                                $s .= ' ' . $this->getTimeRangeString( 
$row->first, $row->last ) . ' ';
                                // @todo FIXME: Hard coded brackets.
@@ -1009,19 +1009,19 @@
                // OK, do the real query...
                $ret = $dbr->select(
                        'cu_changes',
-                       array(
+                       [
                                'cuc_user_text', 'cuc_timestamp', 'cuc_user', 
'cuc_ip', 'cuc_agent', 'cuc_xff'
-                       ),
-                       array( $ip_conds, $time_conds ),
+                       ],
+                       [ $ip_conds, $time_conds ],
                        __METHOD__,
-                       array(
+                       [
                                'ORDER BY' => 'cuc_timestamp DESC',
                                'LIMIT' => 10000,
                                'USE INDEX' => $index,
-                       )
+                       ]
                );
 
-               $users_first = $users_last = $users_edits = $users_ids = 
$users_agentsets = $users_infosets = array();
+               $users_first = $users_last = $users_edits = $users_ids = 
$users_agentsets = $users_infosets = [];
                if ( !$dbr->numRows( $ret ) ) {
                        $s = $this->noMatchesMessage( $ip, !$xfor ) . "\n";
                } else {
@@ -1030,14 +1030,14 @@
                                        $users_last[$row->cuc_user_text] = 
$row->cuc_timestamp;
                                        $users_edits[$row->cuc_user_text] = 0;
                                        $users_ids[$row->cuc_user_text] = 
$row->cuc_user;
-                                       $users_infosets[$row->cuc_user_text] = 
array();
-                                       $users_agentsets[$row->cuc_user_text] = 
array();
+                                       $users_infosets[$row->cuc_user_text] = 
[];
+                                       $users_agentsets[$row->cuc_user_text] = 
[];
                                }
                                $users_edits[$row->cuc_user_text] += 1;
                                $users_first[$row->cuc_user_text] = 
$row->cuc_timestamp;
                                // Treat blank or NULL xffs as empty strings
                                $xff = empty( $row->cuc_xff ) ? null : 
$row->cuc_xff;
-                               $xff_ip_combo = array( $row->cuc_ip, $xff );
+                               $xff_ip_combo = [ $row->cuc_ip, $xff ];
                                // Add this IP/XFF combo for this username if 
it's not already there
                                if ( !in_array( $xff_ip_combo, 
$users_infosets[$row->cuc_user_text] ) ) {
                                        $users_infosets[$row->cuc_user_text][] 
= $xff_ip_combo;
@@ -1056,7 +1056,7 @@
                        $s .= '<div id="checkuserresults"><ul>';
                        foreach ( $users_edits as $name => $count ) {
                                $s .= '<li>';
-                               $s .= Xml::check( 'users[]', false, array( 
'value' => $name ) ) . '&#160;';
+                               $s .= Xml::check( 'users[]', false, [ 'value' 
=> $name ] ) . '&#160;';
                                // Load user object
                                $user = User::newFromName( $name, false );
                                // Add user page and tool links
@@ -1068,10 +1068,10 @@
                                $s .= ' ' . $this->msg( 'parentheses' 
)->rawParams(
                                        $this->getSelfLink(
                                                $this->msg( 'checkuser-check' 
)->text(),
-                                               array(
+                                               [
                                                        'user' => $name,
                                                        'reason' => $reason
-                                               )
+                                               ]
                                        )
                                )->escaped();
                                // Show edit time range
@@ -1097,7 +1097,7 @@
                                        $set = $users_infosets[$name][$i];
                                        // IP link
                                        $s .= '<li>';
-                                       $s .= $this->getSelfLink( $set[0], 
array( 'user' => $set[0] ) );
+                                       $s .= $this->getSelfLink( $set[0], [ 
'user' => $set[0] ] );
                                        // XFF string, link to /xff search
                                        if ( $set[1] ) {
                                                // Flag our trusted proxies
@@ -1106,7 +1106,7 @@
                                                $trusted = ( $client === 
$row->cuc_ip );
                                                $c = $trusted ? '#F0FFF0' : 
'#FFFFCC';
                                                $s .= '&#160;&#160;&#160;<span 
style="background-color: ' . $c . '"><strong>XFF</strong>: ';
-                                               $s .= $this->getSelfLink( 
$set[1], array( 'user' => $client . '/xff' ) ) . '</span>';
+                                               $s .= $this->getSelfLink( 
$set[1], [ 'user' => $client . '/xff' ] ) . '</span>';
                                        }
                                        $s .= "</li>\n";
                                }
@@ -1167,28 +1167,28 @@
                $s .= '<legend>' . $this->msg( 'checkuser-massblock' 
)->escaped() . "</legend>\n";
                $s .= $this->msg( 'checkuser-massblock-text' )->parseAsBlock() 
. "\n";
                $s .= '<table><tr>' .
-                       '<td>' . Xml::check( 'usetag', false, array( 'id' => 
'usetag' ) ) . '</td>' .
+                       '<td>' . Xml::check( 'usetag', false, [ 'id' => 
'usetag' ] ) . '</td>' .
                        '<td>' . Xml::label( $this->msg( 'checkuser-blocktag' 
)->escaped(), 'usetag' ) . '</td>' .
-                       '<td>' . Xml::input( 'tag', 46, $tag, array( 'id' => 
'blocktag' ) ) . '</td>' .
+                       '<td>' . Xml::input( 'tag', 46, $tag, [ 'id' => 
'blocktag' ] ) . '</td>' .
                        '</tr><tr>' .
-                       '<td>' . Xml::check( 'usettag', false, array( 'id' => 
'usettag' ) ) . '</td>' .
+                       '<td>' . Xml::check( 'usettag', false, [ 'id' => 
'usettag' ] ) . '</td>' .
                        '<td>' . Xml::label( $this->msg( 
'checkuser-blocktag-talk' )->escaped(), 'usettag' ) . '</td>' .
-                       '<td>' . Xml::input( 'talktag', 46, $talkTag, array( 
'id' => 'talktag' ) ) . '</td>';
+                       '<td>' . Xml::input( 'talktag', 46, $talkTag, [ 'id' => 
'talktag' ] ) . '</td>';
                if ( $wgBlockAllowsUTEdit ) {
                        $s .= '</tr><tr>' .
-                               '<td>' . Xml::check( 'blocktalk', false, array( 
'id' => 'blocktalk' ) ) . '</td>' .
+                               '<td>' . Xml::check( 'blocktalk', false, [ 'id' 
=> 'blocktalk' ] ) . '</td>' .
                                '<td>' . Xml::label( $this->msg( 
'checkuser-blocktalk' )->escaped(), 'blocktalk' ) . '</td>';
                }
                if ( SpecialBlock::canBlockEmail( $this->getUser() ) ) {
                        $s .= '</tr><tr>' .
-                               '<td>' . Xml::check( 'blockemail', false, 
array( 'id' => 'blockemail' ) ) . '</td>' .
+                               '<td>' . Xml::check( 'blockemail', false, [ 
'id' => 'blockemail' ] ) . '</td>' .
                                '<td>' . Xml::label( $this->msg( 
'checkuser-blockemail' )->escaped(), 'blockemail' ) . '</td>';
                }
                $s .= '</tr></table>';
                $s .= '<p>' . $this->msg( 'checkuser-reason' )->escaped() . 
'&#160;';
-               $s .= Xml::input( 'blockreason', 46, '', array( 'maxlength' => 
'150', 'id' => 'blockreason' ) );
+               $s .= Xml::input( 'blockreason', 46, '', [ 'maxlength' => 
'150', 'id' => 'blockreason' ] );
                $s .= '&#160;' . Xml::submitButton( $this->msg( 
'checkuser-massblock-commit' )->escaped(),
-                       array( 'id' => 'checkuserblocksubmit', 'name' => 
'checkuserblock' ) ) . "</p>\n";
+                       [ 'id' => 'checkuserblocksubmit', 'name' => 
'checkuserblock' ] ) . "</p>\n";
                $s .= "</fieldset>\n";
 
                return $s;
@@ -1209,7 +1209,7 @@
                return Linker::linkKnown(
                        $title,
                        htmlspecialchars( $text ),
-                       array(),
+                       [],
                        $params
                );
        }
@@ -1221,7 +1221,7 @@
         * @return array
         */
        protected function userBlockFlags( $ip, $userId, $user ) {
-               $flags = array();
+               $flags = [];
 
                $block = Block::newFromTarget( $user, $ip, false );
                if ( $block instanceof Block ) {
@@ -1236,11 +1236,11 @@
                        $blocklog = Linker::linkKnown(
                                SpecialPage::getTitleFor( 'Log' ),
                                $this->msg( 'checkuser-wasblocked' )->escaped(),
-                               array(),
-                               array(
+                               [],
+                               [
                                        'type' => 'block',
                                        'page' => $userpage->getPrefixedText()
-                               )
+                               ]
                        );
                        // @todo FIXME: Hard coded parentheses.
                        $flags[] = '<strong>(' . $blocklog . ')</strong>';
@@ -1259,7 +1259,7 @@
                                // @todo FIXME: i18n issue: Hard coded 
parentheses.
                                $flags[] = '<b>(' . $this->msg( 
'checkuser-locked' )->escaped() . ')</b>';
                        }
-                       $list = array();
+                       $list = [];
                        foreach ( $user->getGroups() as $group ) {
                                $list[] = self::buildGroupLink( $group, 
$user->getName() );
                        }
@@ -1326,10 +1326,10 @@
                // IP
                $line .= ' <strong>IP</strong>: ';
                $line .= $this->getSelfLink( $row->cuc_ip,
-                       array(
+                       [
                                'user' => $row->cuc_ip,
                                'reason' => $reason
-                       )
+                       ]
                );
                // XFF
                if ( $row->cuc_xff != null ) {
@@ -1341,10 +1341,10 @@
                        $line .= '<span class="mw-checkuser-xff" 
style="background-color: ' . $c . '">' .
                                '<strong>XFF</strong>: ';
                        $line .= $this->getSelfLink( $row->cuc_xff,
-                               array(
+                               [
                                        'user' => $client . '/xff',
                                        'reason' => $reason
-                               )
+                               ]
                        );
                        $line .= '</span>';
                }
@@ -1393,7 +1393,7 @@
         * @return string diff, hist and page other links related to the change
         */
        protected function getLinksFromRow( $row ) {
-               $links = array();
+               $links = [];
                // Log items
                if ( $row->cuc_type == RC_LOG ) {
                        $title = Title::makeTitle( $row->cuc_namespace, 
$row->cuc_title );
@@ -1401,8 +1401,8 @@
                        $links['log'] = '(' . Linker::linkKnown(
                                SpecialPage::getTitleFor( 'Log' ),
                                $this->message['log'],
-                               array(),
-                               array( 'page' => $title->getPrefixedText() )
+                               [],
+                               [ 'page' => $title->getPrefixedText() ]
                        ) . ')';
                } else {
                        $title = Title::makeTitle( $row->cuc_namespace, 
$row->cuc_title );
@@ -1415,12 +1415,12 @@
                                $links['diff'] = ' (' . Linker::linkKnown(
                                        $title,
                                        $this->message['diff'],
-                                       array(),
-                                       array(
+                                       [],
+                                       [
                                                'curid' => $row->cuc_page_id,
                                                'diff' => $row->cuc_this_oldid,
                                                'oldid' => $row->cuc_last_oldid
-                                       )
+                                       ]
                                ) . ') ';
                        }
                        // History link
@@ -1428,11 +1428,11 @@
                        $links['history'] = ' (' . Linker::linkKnown(
                                $title,
                                $this->message['hist'],
-                               array(),
-                               array(
+                               [],
+                               [
                                        'curid' => $row->cuc_page_id,
                                        'action' => 'history'
-                               )
+                               ]
                        ) . ') . . ';
                        // Some basic flags
                        if ( $row->cuc_type == RC_NEW ) {
@@ -1445,7 +1445,7 @@
                        $links['title'] = Linker::link( $title );
                }
 
-               Hooks::run( 'SpecialCheckUserGetLinksFromRow', array( $this, 
$row, &$links ) );
+               Hooks::run( 'SpecialCheckUserGetLinksFromRow', [ $this, $row, 
&$links ] );
                if ( is_array( $links ) ) {
                        return implode( ' ', $links );
                } else {
@@ -1460,14 +1460,14 @@
        protected static function userWasBlocked( $name ) {
                $userpage = Title::makeTitle( NS_USER, $name );
                return (bool)wfGetDB( DB_SLAVE )->selectField( 'logging', '1',
-                       array(
-                               'log_type' => array( 'block', 'suppress' ),
+                       [
+                               'log_type' => [ 'block', 'suppress' ],
                                'log_action' => 'block',
                                'log_namespace' => $userpage->getNamespace(),
                                'log_title' => $userpage->getDBkey()
-                       ),
+                       ],
                        __METHOD__,
-                       array( 'USE INDEX' => 'page_time' ) );
+                       [ 'USE INDEX' => 'page_time' ] );
        }
 
        /**
@@ -1478,7 +1478,7 @@
         * @return string
         */
        protected static function buildGroupLink( $group, $username ) {
-               static $cache = array();
+               static $cache = [];
                if ( !isset( $cache[$group] ) ) {
                        $cache[$group] = User::makeGroupLinkHTML( $group, 
User::getGroupMember( $group, $username ) );
                }
@@ -1494,28 +1494,28 @@
        public static function getIpConds( $db, $ip, $xfor = false ) {
                global $wgCheckUserCIDRLimit;
                $type = $xfor ? 'xff' : 'ip';
-               $matches = array();
+               $matches = [];
                if ( preg_match( '#^(\d+\.\d+\.\d+\.\d+)/(\d+)$#', $ip, 
$matches ) ) {
                        // IPv4 CIDR, 16-32 bits
                        if ( $matches[2] < $wgCheckUserCIDRLimit['IPv4'] || 
$matches[2] > 32 ) {
                                return false; // invalid
                        }
                        list( $start, $end ) = IP::parseRange( $ip );
-                       return array( 'cuc_' . $type . '_hex BETWEEN ' . 
$db->addQuotes( $start ) . ' AND ' . $db->addQuotes( $end ) );
+                       return [ 'cuc_' . $type . '_hex BETWEEN ' . 
$db->addQuotes( $start ) . ' AND ' . $db->addQuotes( $end ) ];
                } elseif ( preg_match( 
'#^\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}/(\d+)$#', 
$ip, $matches ) ) {
                        // IPv6 CIDR, 32-128 bits
                        if ( $matches[1] < $wgCheckUserCIDRLimit['IPv6'] || 
$matches[1] > 128 ) {
                                return false; // invalid
                        }
                        list( $start, $end ) = IP::parseRange( $ip );
-                       return array( 'cuc_' . $type . '_hex BETWEEN ' . 
$db->addQuotes( $start ) . ' AND ' . $db->addQuotes( $end ) );
+                       return [ 'cuc_' . $type . '_hex BETWEEN ' . 
$db->addQuotes( $start ) . ' AND ' . $db->addQuotes( $end ) ];
                } elseif (
                        // 32 bit IPv4
                        preg_match( '#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#', $ip ) ||
                        // 128 bit IPv6
                        preg_match( 
'#^\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}:\w{1,4}$#', $ip )
                ) {
-                       return array( "cuc_{$type}_hex" => IP::toHex( $ip ) );
+                       return [ "cuc_{$type}_hex" => IP::toHex( $ip ) ];
                }
                // Throw away this query, incomplete IP, these don't get 
through the entry point anyway
                return false;
@@ -1546,7 +1546,7 @@
                }
 
                $timestamp = time();
-               $data = array(
+               $data = [
                        'cul_user' => $user->getId(),
                        'cul_user_text' => $user->getName(),
                        'cul_reason' => $reason,
@@ -1556,7 +1556,7 @@
                        'cul_target_hex' => $targetHex,
                        'cul_range_start' => $rangeStart,
                        'cul_range_end' => $rangeEnd
-               );
+               ];
 
                DeferredUpdates::addCallableUpdate(
                        function () use ( $data, $timestamp ) {
@@ -1584,12 +1584,12 @@
         */
        public function prefixSearchSubpages( $search, $limit, $offset ) {
                if ( !class_exists( 'UserNamePrefixSearch' ) ) { // check for 
version 1.27
-                       return array();
+                       return [];
                }
                $user = User::newFromName( $search );
                if ( !$user ) {
                        // No prefix suggestion for invalid user
-                       return array();
+                       return [];
                }
                // Autocomplete subpage as user list - public to allow caching
                return UserNamePrefixSearch::search( 'public', $search, $limit, 
$offset );
diff --git a/specials/SpecialCheckUserLog.php b/specials/SpecialCheckUserLog.php
index 7d2cbd4..7f3121b 100644
--- a/specials/SpecialCheckUserLog.php
+++ b/specials/SpecialCheckUserLog.php
@@ -31,7 +31,7 @@
                $this->displaySearchForm();
 
                // Default to all log entries - we'll add conditions below if a 
target was provided
-               $searchConds = array();
+               $searchConds = [];
 
                if ( $this->target !== '' ) {
                        $searchConds = ( $type === 'initiator' )
@@ -47,11 +47,11 @@
 
                $pager = new CheckUserLogPager(
                        $this->getContext(),
-                       array(
+                       [
                                'queryConds' => $searchConds,
                                'year' => $request->getInt( 'year' ),
                                'month' => $request->getInt( 'month' ),
-                       )
+                       ]
                );
 
                $out->addHTML(
@@ -66,8 +66,8 @@
         */
        protected function displaySearchForm() {
                $request = $this->getRequest();
-               $fields = array(
-                       'target' => array(
+               $fields = [
+                       'target' => [
                                'type' => 'user',
                                // validation in execute() currently
                                'exists' => false,
@@ -76,25 +76,25 @@
                                'size' => 40,
                                'label-message' => 
'checkuser-log-search-target',
                                'default' => $this->target,
-                       ),
-                       'type' => array(
+                       ],
+                       'type' => [
                                'type' => 'radio',
                                'name' => 'cuSearchType',
                                'label-message' => 'checkuser-log-search-type',
-                               'options-messages' => array(
+                               'options-messages' => [
                                        'checkuser-search-target' => 'target',
                                        'checkuser-search-initiator' => 
'initiator',
-                               ),
+                               ],
                                'flatlist' => true,
                                'default' => 'target',
-                       ),
+                       ],
                        // @todo hack until HTMLFormField has a proper date 
selector
-                       'monthyear' => array(
+                       'monthyear' => [
                                'type' => 'info',
                                'default' => Xml::dateMenu( $request->getInt( 
'year' ), $request->getInt( 'month' ) ),
                                'raw' => true,
-                       ),
-               );
+                       ],
+               ];
 
                $form = HTMLForm::factory( 'table', $fields, 
$this->getContext() );
                $form->setMethod( 'get' )
@@ -113,7 +113,7 @@
        protected function getPerformerSearchConds() {
                $initiator = User::newFromName( $this->target );
                if ( $initiator && $initiator->getId() ) {
-                       return array( 'cul_user' => $initiator->getId() );
+                       return [ 'cul_user' => $initiator->getId() ];
                }
                return null;
        }
@@ -131,28 +131,28 @@
                        $dbr = wfGetDB( DB_SLAVE );
                        if ( $start === $end ) {
                                // Single IP address
-                               $conds = array(
+                               $conds = [
                                        'cul_target_hex = ' . $dbr->addQuotes( 
$start ) . ' OR ' .
                                        '(cul_range_end >= ' . $dbr->addQuotes( 
$start ) . ' AND ' .
                                        'cul_range_start <= ' . 
$dbr->addQuotes( $start ) . ')'
-                               );
+                               ];
                        } else {
                                // IP range
-                               $conds = array(
+                               $conds = [
                                        '(cul_target_hex >= ' . 
$dbr->addQuotes( $start ) . ' AND ' .
                                        'cul_target_hex <= ' . $dbr->addQuotes( 
$end ) . ') OR ' .
                                        '(cul_range_end >= ' . $dbr->addQuotes( 
$start ) . ' AND ' .
                                        'cul_range_start <= ' . 
$dbr->addQuotes( $end ) . ')'
-                               );
+                               ];
                        }
                } else {
                        $user = User::newFromName( $this->target );
                        if ( $user && $user->getId() ) {
                                // Registered user
-                               $conds = array(
-                                       'cul_type' => array( 'userips', 
'useredits' ),
+                               $conds = [
+                                       'cul_type' => [ 'userips', 'useredits' 
],
                                        'cul_target_id' => $user->getId(),
-                               );
+                               ];
                        }
                }
                return $conds;

-- 
To view, visit https://gerrit.wikimedia.org/r/324854
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I915817daedb7cd9201da5fee5fe0db57f90f0f84
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CheckUser
Gerrit-Branch: master
Gerrit-Owner: Legoktm <lego...@member.fsf.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to