/** * Determines the article for the given type ('a' or 'an'), depending on the first char * * @param PC_Obj_MultiType $type the type * @return string the article */ private function get_article($type) { $str = $type === null ? 'x' : $type->__ToString(); return isset($str[0]) && in_array(strtolower($str[0]), array('i', 'a', 'o', 'u', 'e')) ? 'an' : 'a'; }