[MediaWiki-commits] [Gerrit] mediawiki...SecurePoll[master]: Use short array syntax - cli
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/358072 ) Change subject: Use short array syntax - cli .. Use short array syntax - cli Done by phpcbf over composer fix Change-Id: Idd3caa4eaf982d8bd21afc3c0e8766fe390021ba --- M cli/convertVotes.php M cli/delete.php M cli/dump.php M cli/dumpComments.php M cli/dumpVoteCsv.php M cli/import.php M cli/makeSimpleList.php M cli/purgePrivateVoteData.php M cli/tally.php M cli/testDebian.php M cli/voterList.php M cli/wm-scripts/bv2013/buildSpamTranslations.php M cli/wm-scripts/bv2013/doSpam.php M cli/wm-scripts/bv2013/dumpMetaTranslations.php M cli/wm-scripts/bv2013/populateEditCount.php M cli/wm-scripts/bv2013/sendMails.php M cli/wm-scripts/bv2013/voterList.php M cli/wm-scripts/bv2015/doSpam.php M cli/wm-scripts/bv2015/populateEditCount-fixup.php M cli/wm-scripts/bv2015/populateEditCount.php M cli/wm-scripts/bv2015/voterList.php M cli/wm-scripts/bv2017/doSpam.php M cli/wm-scripts/bv2017/populateEditCount.php M cli/wm-scripts/bv2017/voterList.php M cli/wm-scripts/dumpGlobalVoterList.php 25 files changed, 282 insertions(+), 282 deletions(-) Approvals: Huji: Looks good to me, approved jenkins-bot: Verified diff --git a/cli/convertVotes.php b/cli/convertVotes.php index ed9c385..b69198d 100644 --- a/cli/convertVotes.php +++ b/cli/convertVotes.php @@ -57,12 +57,12 @@ } function convert( $electionId ) { - $this->votes = array(); + $this->votes = []; $this->crypt = $this->election->getCrypt(); $this->ballot = $this->election->getBallot(); $status = $this->context->getStore()->callbackValidVotes( - $electionId, array( $this, 'convertVote' ) ); + $electionId, [ $this, 'convertVote' ] ); if ( !$status->isOK() ) { spFatal( "Error: " . $status->getWikiText() ); } @@ -72,7 +72,7 @@ $s .= str_repeat( '-', 80 ) . "\n\n"; } $s .= $question->getMessage( 'text' ) . "\n"; - $names = array(); + $names = []; foreach ( $question->getOptions() as $option ) { $names[$option->getId()] = $option->getMessage( 'text' ); } diff --git a/cli/delete.php b/cli/delete.php index 17443ed..60ae029 100644 --- a/cli/delete.php +++ b/cli/delete.php @@ -29,8 +29,8 @@ $dbw = wfGetDB( DB_MASTER ); $type = $dbw->selectField( 'securepoll_entity', 'en_type', - array( 'en_id' => $electionId ), - __METHOD__, array( 'FOR UPDATE' ) ); + [ 'en_id' => $electionId ], + __METHOD__, [ 'FOR UPDATE' ] ); if ( !$type ) { echo "The specified id does not exist.\n"; return false; @@ -41,37 +41,37 @@ } # Get a list of entity IDs and lock them - $questionIds = array(); - $res = $dbw->select( 'securepoll_questions', array( 'qu_entity' ), - array( 'qu_election' => $electionId ), - __METHOD__, array( 'FOR UPDATE' ) ); + $questionIds = []; + $res = $dbw->select( 'securepoll_questions', [ 'qu_entity' ], + [ 'qu_election' => $electionId ], + __METHOD__, [ 'FOR UPDATE' ] ); foreach ( $res as $row ) { $questionIds[] = $row->qu_entity; } - $res = $dbw->select( 'securepoll_options', array( 'op_entity' ), - array( 'op_election' => $electionId ), - __METHOD__, array( 'FOR UPDATE' ) ); - $optionIds = array(); + $res = $dbw->select( 'securepoll_options', [ 'op_entity' ], + [ 'op_election' => $electionId ], + __METHOD__, [ 'FOR UPDATE' ] ); + $optionIds = []; foreach ( $res as $row ) { $optionIds[] = $row->op_entity; } - $entityIds = array_merge( $optionIds, $questionIds, array( $electionId ) ); + $entityIds = array_merge( $optionIds, $questionIds, [ $electionId ] ); # Delete the messages and properties - $dbw->delete( 'securepoll_msgs', array( 'msg_entity' => $entityIds ) ); - $dbw->delete( 'securepoll_properties', array( 'pr_entity' => $entityIds ) ); + $dbw->delete( 'securepoll_msgs', [ 'msg_entity' => $entityIds ] ); + $dbw->delete( 'securepoll_properties', [ 'pr_entity' => $entityIds ] ); # Delete the entities if ( $optionIds ) { - $dbw->delete( 'securepoll_options', array( 'op_entity' => $optionIds ), __METHOD__ ); + $dbw->delete( 'securepoll_options', [ 'op_entity' => $optionIds ], __METHOD__ ); } if ( $questionIds ) { - $dbw->delete(
[MediaWiki-commits] [Gerrit] mediawiki...SecurePoll[master]: Use short array syntax - cli
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/358072 ) Change subject: Use short array syntax - cli .. Use short array syntax - cli Done by phpcbf over composer fix Change-Id: Idd3caa4eaf982d8bd21afc3c0e8766fe390021ba --- M cli/convertVotes.php M cli/delete.php M cli/dump.php M cli/dumpComments.php M cli/dumpVoteCsv.php M cli/import.php M cli/makeSimpleList.php M cli/purgePrivateVoteData.php M cli/tally.php M cli/testDebian.php M cli/voterList.php M cli/wm-scripts/bv2013/buildSpamTranslations.php M cli/wm-scripts/bv2013/doSpam.php M cli/wm-scripts/bv2013/dumpMetaTranslations.php M cli/wm-scripts/bv2013/populateEditCount.php M cli/wm-scripts/bv2013/sendMails.php M cli/wm-scripts/bv2013/voterList.php M cli/wm-scripts/bv2015/doSpam.php M cli/wm-scripts/bv2015/populateEditCount-fixup.php M cli/wm-scripts/bv2015/populateEditCount.php M cli/wm-scripts/bv2015/voterList.php M cli/wm-scripts/bv2017/doSpam.php M cli/wm-scripts/bv2017/populateEditCount.php M cli/wm-scripts/bv2017/voterList.php M cli/wm-scripts/dumpGlobalVoterList.php 25 files changed, 282 insertions(+), 282 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecurePoll refs/changes/72/358072/1 diff --git a/cli/convertVotes.php b/cli/convertVotes.php index ed9c385..b69198d 100644 --- a/cli/convertVotes.php +++ b/cli/convertVotes.php @@ -57,12 +57,12 @@ } function convert( $electionId ) { - $this->votes = array(); + $this->votes = []; $this->crypt = $this->election->getCrypt(); $this->ballot = $this->election->getBallot(); $status = $this->context->getStore()->callbackValidVotes( - $electionId, array( $this, 'convertVote' ) ); + $electionId, [ $this, 'convertVote' ] ); if ( !$status->isOK() ) { spFatal( "Error: " . $status->getWikiText() ); } @@ -72,7 +72,7 @@ $s .= str_repeat( '-', 80 ) . "\n\n"; } $s .= $question->getMessage( 'text' ) . "\n"; - $names = array(); + $names = []; foreach ( $question->getOptions() as $option ) { $names[$option->getId()] = $option->getMessage( 'text' ); } diff --git a/cli/delete.php b/cli/delete.php index 17443ed..60ae029 100644 --- a/cli/delete.php +++ b/cli/delete.php @@ -29,8 +29,8 @@ $dbw = wfGetDB( DB_MASTER ); $type = $dbw->selectField( 'securepoll_entity', 'en_type', - array( 'en_id' => $electionId ), - __METHOD__, array( 'FOR UPDATE' ) ); + [ 'en_id' => $electionId ], + __METHOD__, [ 'FOR UPDATE' ] ); if ( !$type ) { echo "The specified id does not exist.\n"; return false; @@ -41,37 +41,37 @@ } # Get a list of entity IDs and lock them - $questionIds = array(); - $res = $dbw->select( 'securepoll_questions', array( 'qu_entity' ), - array( 'qu_election' => $electionId ), - __METHOD__, array( 'FOR UPDATE' ) ); + $questionIds = []; + $res = $dbw->select( 'securepoll_questions', [ 'qu_entity' ], + [ 'qu_election' => $electionId ], + __METHOD__, [ 'FOR UPDATE' ] ); foreach ( $res as $row ) { $questionIds[] = $row->qu_entity; } - $res = $dbw->select( 'securepoll_options', array( 'op_entity' ), - array( 'op_election' => $electionId ), - __METHOD__, array( 'FOR UPDATE' ) ); - $optionIds = array(); + $res = $dbw->select( 'securepoll_options', [ 'op_entity' ], + [ 'op_election' => $electionId ], + __METHOD__, [ 'FOR UPDATE' ] ); + $optionIds = []; foreach ( $res as $row ) { $optionIds[] = $row->op_entity; } - $entityIds = array_merge( $optionIds, $questionIds, array( $electionId ) ); + $entityIds = array_merge( $optionIds, $questionIds, [ $electionId ] ); # Delete the messages and properties - $dbw->delete( 'securepoll_msgs', array( 'msg_entity' => $entityIds ) ); - $dbw->delete( 'securepoll_properties', array( 'pr_entity' => $entityIds ) ); + $dbw->delete( 'securepoll_msgs', [ 'msg_entity' => $entityIds ] ); + $dbw->delete( 'securepoll_properties', [ 'pr_entity' => $entityIds ] ); # Delete the entities if ( $optionIds ) { - $dbw->delete( 'securepoll_options', array( 'op_entity' => $optionIds ), __METHOD__ ); + $dbw->delete( 'securepoll_options', [ 'op_entity' => $optionIds ], __METHOD__ ); } if ( $questionIds ) { -