original_string: public function getStateCandidates(int $state): array
      {
          $candidates = [];
  
          foreach ($this->candidates as $candidateId => $candidate) {
              if ($candidate->getState() == $state) {
                  $candidates[$candidateId] = $candidate;
              }
          }
  
          return $candidates;
      }
code: public function getStateCandidates(int $state): array
      {
          $candidates = [];
  
          foreach ($this->candidates as $candidateId => $candidate) {
              if ($candidate->getState() == $state) {
                  $candidates[$candidateId] = $candidate;
              }
          }
  
          return $candidates;
      }
code_tokens: public function getStateCandidates ( int $ state ) : array { $ candidates = [ ] ; foreach ( $ this -> candidates as $ candidateId => $ candidate ) { if ( $ candidate -> getState ( ) == $ state ) { $ candidates [ $ candidateId ] = $ candidate ; } } return $ candidates ; }
docstring: Get all candidates of a specific state.
  
  @param int $state A candidate state (See Candidate constants)
  
  @return \Michaelc\Voting\STV\Candidate[]
docstring_tokens: Get all candidates of a specific state .