protected function determineCountType($words) { foreach ($words as $word) { if (isset($this->countTypes[$word])) { return $this->countTypes[$word]; } } // if we do not recognise the word, tell the caller return null; }