PHP Класс CommerceGuys\Addressing\LocaleHelper

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
canonicalize ( string $locale = null ) : string Canonicalize the given locale.
getVariants ( string $locale ) : array Gets all variants of a locale.
match ( string $firstLocale, string $secondLocale ) : boolean Checks whether the two locales match.

Описание методов

canonicalize() публичный статический Метод

Canonicalize the given locale.
public static canonicalize ( string $locale = null ) : string
$locale string The locale.
Результат string The canonicalized locale.

getVariants() публичный статический Метод

For example, "bs-Cyrl-BA" has the following variants: 1) bs-Cyrl-BA 2) bs-Cyrl 3) bs
public static getVariants ( string $locale ) : array
$locale string The locale (i.e. fr-FR).
Результат array An array of all variants of a locale.

match() публичный статический Метод

Checks whether the two locales match.
public static match ( string $firstLocale, string $secondLocale ) : boolean
$firstLocale string The first locale.
$secondLocale string The second locale.
Результат boolean TRUE if the locales match, FALSE otherwise.