public function getCandidatesStatus(): array
    {
        $candidates = [];

        foreach ($this->getElectedCandidates() as $candidate) {
            $candidates['elected'][] = $candidate->getId();
        }

        foreach ($this->getActiveCandidates() as $candidate) {
            $candidates['active'][] = [$candidate->getId(), $candidate->getVotes()];
        }

        foreach ($this->getDefeatedCandidates() as $candidate) {
            $candidates['defeated'][] = $candidate->getId();
        }

        return $candidates;
    }
public function getCandidatesStatus(): array
    {
        $candidates = [];

        foreach ($this->getElectedCandidates() as $candidate) {
            $candidates['elected'][] = $candidate->getId();
        }

        foreach ($this->getActiveCandidates() as $candidate) {
            $candidates['active'][] = [$candidate->getId(), $candidate->getVotes()];
        }

        foreach ($this->getDefeatedCandidates() as $candidate) {
            $candidates['defeated'][] = $candidate->getId();
        }

        return $candidates;
    }
public function getCandidatesStatus ( ) : array { $ candidates = [ ] ; foreach ( $ this -> getElectedCandidates ( ) as $ candidate ) { $ candidates [ 'elected' ] [ ] = $ candidate -> getId ( ) ; } foreach ( $ this -> getActiveCandidates ( ) as $ candidate ) { $ candidates [ 'active' ] [ ] = [ $ candidate -> getId ( ) , $ candidate -> getVotes ( ) ] ; } foreach ( $ this -> getDefeatedCandidates ( ) as $ candidate ) { $ candidates [ 'defeated' ] [ ] = $ candidate -> getId ( ) ; } return $ candidates ; }
Get status of all candidates.

@return array
Get status of all candidates .