src/STV/ElectionRunner.php
protected function transferSurplusVotes(float $surplus, Candidate $candidate)
    {
        $totalVotes = $candidate->getVotes();
        $candidateId = $candidate->getId();

        $this->logger->info('Transfering surplus votes');

        foreach ($this->ballots as $i => $ballot) {
            if ($ballot->getLastChoice() == $candidateId) {
                $this->allocateVotes($ballot, $surplus, $totalVotes);
            }
        }

        return;
    }
protected function transferSurplusVotes(float $surplus, Candidate $candidate)
    {
        $totalVotes = $candidate->getVotes();
        $candidateId = $candidate->getId();

        $this->logger->info('Transfering surplus votes');

        foreach ($this->ballots as $i => $ballot) {
            if ($ballot->getLastChoice() == $candidateId) {
                $this->allocateVotes($ballot, $surplus, $totalVotes);
            }
        }

        return;
    }
protected function transferSurplusVotes ( float $ surplus , Candidate $ candidate ) { $ totalVotes = $ candidate -> getVotes ( ) ; $ candidateId = $ candidate -> getId ( ) ; $ this -> logger -> info ( 'Transfering surplus votes' ) ; foreach ( $ this -> ballots as $ i => $ ballot ) { if ( $ ballot -> getLastChoice ( ) == $ candidateId ) { $ this -> allocateVotes ( $ ballot , $ surplus , $ totalVotes ) ; } } return ; }
Transfer the votes from one candidate to other candidates.

@param float     $surplus   The number of surplus votes to transfer
@param Candidate $candidate The candidate being elected to transfer
the votes from

@return
Transfer the votes from one candidate to other candidates .