public function getStateCandidates(int $state): array
    {
        $candidates = [];

        foreach ($this->candidates as $candidateId => $candidate) {
            if ($candidate->getState() == $state) {
                $candidates[$candidateId] = $candidate;
            }
        }

        return $candidates;
    }
public function getStateCandidates(int $state): array
    {
        $candidates = [];

        foreach ($this->candidates as $candidateId => $candidate) {
            if ($candidate->getState() == $state) {
                $candidates[$candidateId] = $candidate;
            }
        }

        return $candidates;
    }
public function getStateCandidates ( int $ state ) : array { $ candidates = [ ] ; foreach ( $ this -> candidates as $ candidateId => $ candidate ) { if ( $ candidate -> getState ( ) == $ state ) { $ candidates [ $ candidateId ] = $ candidate ; } } return $ candidates ; }
Get all candidates of a specific state.

@param int $state A candidate state (See Candidate constants)

@return \Michaelc\Voting\STV\Candidate[]
Get all candidates of a specific state .