Automattic\Phone\Mobile_Validator::get_iso3166_entry PHP Метод

get_iso3166_entry() приватный Метод

private get_iso3166_entry ( $country_name )
    private function get_iso3166_entry($country_name)
    {
        switch (strlen($country_name)) {
            case 0:
                $usa_entry = Iso3166::get_data()[0];
                return $usa_entry;
            case 2:
                $country_name_upper = strtoupper($country_name);
                foreach (Iso3166::get_data() as $iso3166_entry) {
                    if ($country_name_upper == $iso3166_entry["alpha2"]) {
                        return $iso3166_entry;
                    }
                }
            case 3:
                $country_name_upper = strtoupper($country_name);
                foreach (Iso3166::get_data() as $iso3166_entry) {
                    if ($country_name_upper == $iso3166_entry["alpha3"]) {
                        return $iso3166_entry;
                    }
                }
            default:
                $country_name_upper = strtoupper($country_name);
                foreach (Iso3166::get_data() as $iso3166_entry) {
                    if ($country_name_upper == strtoupper($iso3166_entry["country_name"])) {
                        return $iso3166_entry;
                    }
                }
        }
        return array();
    }