[MediaWiki-commits] [Gerrit] mediawiki...SecurePoll[master]: Make phpcs pass - includes/*
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/358065 ) Change subject: Make phpcs pass - includes/* .. Make phpcs pass - includes/* Change-Id: I59a78a920ad911ccbfcd322863683b2d8b5e4134 --- M includes/ballots/ApprovalBallot.php M includes/ballots/Ballot.php M includes/ballots/ChooseBallot.php M includes/ballots/PreferentialBallot.php M includes/ballots/RadioRangeBallot.php M includes/ballots/RadioRangeCommentBallot.php M includes/pages/CreatePage.php M includes/pages/EntryPage.php M includes/pages/ListPage.php M includes/pages/VotePage.php M includes/pages/VoterEligibilityPage.php M includes/talliers/CommentDumper.php M includes/talliers/SchulzeTallier.php M includes/talliers/Tallier.php 14 files changed, 32 insertions(+), 42 deletions(-) Approvals: Huji: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/ballots/ApprovalBallot.php b/includes/ballots/ApprovalBallot.php index ec4c0b1..eb93a2e 100644 --- a/includes/ballots/ApprovalBallot.php +++ b/includes/ballots/ApprovalBallot.php @@ -54,11 +54,11 @@ function unpackRecord( $record ) { $scores = array(); - $itemLength = 2*8 + 7; - for ( $offset = 0; $offset < strlen( $record ); $offset += $itemLength ) { + $itemLength = 2 * 8 + 7; + for ( $offset = 0, $len = strlen( $record ); $offset < $len; $offset += $itemLength ) { if ( !preg_match( '/Q([0-9A-F]{8})-A([0-9A-F]{8})-([yn])--/A', - $record, $m, 0, $offset ) ) - { + $record, $m, 0, $offset ) + ) { wfDebug( __METHOD__.": regex doesn't match\n" ); return false; } diff --git a/includes/ballots/Ballot.php b/includes/ballots/Ballot.php index 10cc35b..2a65f12 100644 --- a/includes/ballots/Ballot.php +++ b/includes/ballots/Ballot.php @@ -220,9 +220,8 @@ * @return false on failure or if cast ballots are hidden, or the output * of unpackRecord(). */ - function getCurrentVote(){ - - if( !$this->election->getOption( 'show-change' ) ){ + function getCurrentVote() { + if ( !$this->election->getOption( 'show-change' ) ) { return false; } @@ -247,7 +246,7 @@ array( $this, 'getCurrentVoteCallback' ), $voter->getId() ); - if( !$status->isOK() ){ + if ( !$status->isOK() ){ return false; } @@ -256,7 +255,7 @@ : false; } - function getCurrentVoteCallback( $store, $record ){ + function getCurrentVoteCallback( $store, $record ) { $this->currentVote = $record; return Status::newGood(); } diff --git a/includes/ballots/ChooseBallot.php b/includes/ballots/ChooseBallot.php index 9eaa29d..5daec53 100644 --- a/includes/ballots/ChooseBallot.php +++ b/includes/ballots/ChooseBallot.php @@ -71,7 +71,7 @@ function unpackRecord( $record ) { $result = array(); $record = trim( $record ); - for ( $offset = 0; $offset < strlen( $record ); $offset += 18 ) { + for ( $offset = 0, $len = strlen( $record ); $offset < $len; $offset += 18 ) { if ( !preg_match( '/Q([0-9A-F]{8})A([0-9A-F]{8})/A', $record, $m, 0, $offset ) ) { wfDebug( __METHOD__.": regex doesn't match\n" ); return false; diff --git a/includes/ballots/PreferentialBallot.php b/includes/ballots/PreferentialBallot.php index 3a8e114..cf68f18 100644 --- a/includes/ballots/PreferentialBallot.php +++ b/includes/ballots/PreferentialBallot.php @@ -101,10 +101,10 @@ function unpackRecord( $record ) { $ranks = array(); $itemLength = 3*8 + 7; - for ( $offset = 0; $offset < strlen( $record ); $offset += $itemLength ) { + for ( $offset = 0, $len = strlen( $record ); $offset < $len; $offset += $itemLength ) { if ( !preg_match( '/Q([0-9A-F]{8})-A([0-9A-F]{8})-R([0-9A-F]{8})--/A', - $record, $m, 0, $offset ) ) - { + $record, $m, 0, $offset ) + ) { wfDebug( __METHOD__.": regex doesn't match\n" ); return false; } @@ -144,4 +144,3 @@ return $result; } } - diff --git a/includes/ballots/RadioRangeBallot.php b/includes/ballots/RadioRangeBallot.php index 0244e50..5f7e739 100644 ---
[MediaWiki-commits] [Gerrit] mediawiki...SecurePoll[master]: Make phpcs pass - includes/*
Umherirrender has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/358065 ) Change subject: Make phpcs pass - includes/* .. Make phpcs pass - includes/* Change-Id: I59a78a920ad911ccbfcd322863683b2d8b5e4134 --- M includes/ballots/ApprovalBallot.php M includes/ballots/Ballot.php M includes/ballots/ChooseBallot.php M includes/ballots/PreferentialBallot.php M includes/ballots/RadioRangeBallot.php M includes/ballots/RadioRangeCommentBallot.php M includes/pages/CreatePage.php M includes/pages/EntryPage.php M includes/pages/ListPage.php M includes/pages/VotePage.php M includes/pages/VoterEligibilityPage.php M includes/talliers/CommentDumper.php M includes/talliers/SchulzeTallier.php M includes/talliers/Tallier.php 14 files changed, 32 insertions(+), 42 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecurePoll refs/changes/65/358065/1 diff --git a/includes/ballots/ApprovalBallot.php b/includes/ballots/ApprovalBallot.php index ec4c0b1..eb93a2e 100644 --- a/includes/ballots/ApprovalBallot.php +++ b/includes/ballots/ApprovalBallot.php @@ -54,11 +54,11 @@ function unpackRecord( $record ) { $scores = array(); - $itemLength = 2*8 + 7; - for ( $offset = 0; $offset < strlen( $record ); $offset += $itemLength ) { + $itemLength = 2 * 8 + 7; + for ( $offset = 0, $len = strlen( $record ); $offset < $len; $offset += $itemLength ) { if ( !preg_match( '/Q([0-9A-F]{8})-A([0-9A-F]{8})-([yn])--/A', - $record, $m, 0, $offset ) ) - { + $record, $m, 0, $offset ) + ) { wfDebug( __METHOD__.": regex doesn't match\n" ); return false; } diff --git a/includes/ballots/Ballot.php b/includes/ballots/Ballot.php index 10cc35b..2a65f12 100644 --- a/includes/ballots/Ballot.php +++ b/includes/ballots/Ballot.php @@ -220,9 +220,8 @@ * @return false on failure or if cast ballots are hidden, or the output * of unpackRecord(). */ - function getCurrentVote(){ - - if( !$this->election->getOption( 'show-change' ) ){ + function getCurrentVote() { + if ( !$this->election->getOption( 'show-change' ) ) { return false; } @@ -247,7 +246,7 @@ array( $this, 'getCurrentVoteCallback' ), $voter->getId() ); - if( !$status->isOK() ){ + if ( !$status->isOK() ){ return false; } @@ -256,7 +255,7 @@ : false; } - function getCurrentVoteCallback( $store, $record ){ + function getCurrentVoteCallback( $store, $record ) { $this->currentVote = $record; return Status::newGood(); } diff --git a/includes/ballots/ChooseBallot.php b/includes/ballots/ChooseBallot.php index 9eaa29d..5daec53 100644 --- a/includes/ballots/ChooseBallot.php +++ b/includes/ballots/ChooseBallot.php @@ -71,7 +71,7 @@ function unpackRecord( $record ) { $result = array(); $record = trim( $record ); - for ( $offset = 0; $offset < strlen( $record ); $offset += 18 ) { + for ( $offset = 0, $len = strlen( $record ); $offset < $len; $offset += 18 ) { if ( !preg_match( '/Q([0-9A-F]{8})A([0-9A-F]{8})/A', $record, $m, 0, $offset ) ) { wfDebug( __METHOD__.": regex doesn't match\n" ); return false; diff --git a/includes/ballots/PreferentialBallot.php b/includes/ballots/PreferentialBallot.php index 3a8e114..cf68f18 100644 --- a/includes/ballots/PreferentialBallot.php +++ b/includes/ballots/PreferentialBallot.php @@ -101,10 +101,10 @@ function unpackRecord( $record ) { $ranks = array(); $itemLength = 3*8 + 7; - for ( $offset = 0; $offset < strlen( $record ); $offset += $itemLength ) { + for ( $offset = 0, $len = strlen( $record ); $offset < $len; $offset += $itemLength ) { if ( !preg_match( '/Q([0-9A-F]{8})-A([0-9A-F]{8})-R([0-9A-F]{8})--/A', - $record, $m, 0, $offset ) ) - { + $record, $m, 0, $offset ) + ) { wfDebug( __METHOD__.": regex doesn't match\n" ); return false; } @@ -144,4 +144,3 @@ return $result; } } - diff --git a/includes/ballots/RadioRangeBallot.php b/includes/ballots/RadioRangeBallot.php index