src/STV/ElectionRunner.php
public function checkBallotValidity(Ballot $ballot): bool
    {
        $ranking = $ballot->getRanking();

        if (!$this->checkCandidateCountValidity($ranking) || !$this->checkBallotVoteDuplicationValidity($ranking) || !$this->checkAllBallotCandidatesValid($ranking))
        {
            return false;
        }

        $this->logger->debug('Ballot is valid');

        return true;
    }
public function checkBallotValidity(Ballot $ballot): bool
    {
        $ranking = $ballot->getRanking();

        if (!$this->checkCandidateCountValidity($ranking) || !$this->checkBallotVoteDuplicationValidity($ranking) || !$this->checkAllBallotCandidatesValid($ranking))
        {
            return false;
        }

        $this->logger->debug('Ballot is valid');

        return true;
    }
public function checkBallotValidity ( Ballot $ ballot ) : bool { $ ranking = $ ballot -> getRanking ( ) ; if ( ! $ this -> checkCandidateCountValidity ( $ ranking ) || ! $ this -> checkBallotVoteDuplicationValidity ( $ ranking ) || ! $ this -> checkAllBallotCandidatesValid ( $ ranking ) ) { return false ; } $ this -> logger -> debug ( 'Ballot is valid' ) ; return true ; }
Check if ballot is valid.

@param Ballot $ballot Ballot to test

@return bool True if valid, false if invalid
Check if ballot is valid .