Skip to content

Commit

Permalink
Update changelog for 2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-boudry committed May 18, 2020
1 parent d2fbe24 commit b59524c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CHANGELOG
=========
All notable changes to this project will be documented in this file.

## [v2.2.0] - 2020-05-05
## [v2.2.0] - 2020-05-18
### Description
Include the new vote method "Two-round voting System", and some minors fix and optimizations.

Expand Down
8 changes: 4 additions & 4 deletions lib/Algo/Methods/Majority/Majority_Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected function compute(): void
endforeach;
endif;

if ( $round === static::MAX_ROUND || reset($roundScore) > (array_sum($roundScore) / 2) ) :
if ( $round === static::MAX_ROUND || \reset($roundScore) > (\array_sum($roundScore) / 2) ) :
$resolved = true;

if ( isset($score[$round - 1]) && $score[$round] === $score[$round - 1] ) :
Expand Down Expand Up @@ -91,7 +91,7 @@ protected function compute(): void
foreach ($score as $oneRound) :
$lastScore = null;
foreach ($oneRound as $candidateKey => $candidateScore) :
if (!in_array($candidateKey, $doneCandidates, true)) :
if (!\in_array($candidateKey, $doneCandidates, true)) :
if ($candidateScore === $lastScore) :
$doneCandidates[] = $result[$rank][] = $candidateKey;
else :
Expand Down Expand Up @@ -121,7 +121,7 @@ protected function doOneRound () : array
if ( !empty($this->_admittedCandidates) ) :
foreach ($oneRanking as $rankKey => $oneRank) :
foreach ($oneRank as $InRankKey => $oneCandidate) :
if ( !in_array($this->_selfElection->getCandidateKey($oneCandidate), $this->_admittedCandidates, true) ) :
if ( !\in_array($this->_selfElection->getCandidateKey($oneCandidate), $this->_admittedCandidates, true) ) :
unset($oneRanking[$rankKey][$InRankKey]);
endif;
endforeach;
Expand All @@ -131,7 +131,7 @@ protected function doOneRound () : array
endif;
endforeach;

if( ($newFirstRank = reset($oneRanking)) !== false ) :
if( ($newFirstRank = \reset($oneRanking)) !== false ) :
$oneRanking = [1 => $newFirstRank];
else :
continue;
Expand Down

0 comments on commit b59524c

Please sign in to comment.