1 | <?php namespace Fisharebest\Localization; |
||
13 | class Locale |
||
14 | { |
||
15 | /** |
||
16 | * Callback for PHP sort functions - allows lists of locales to be sorted. |
||
17 | * Diacritics are removed and text is capitalized to allow fast/simple sorting. |
||
18 | * |
||
19 | * @param LocaleInterface $x |
||
20 | * @param LocaleInterface $y |
||
21 | * |
||
22 | * @return int |
||
23 | */ |
||
24 | public static function compare(LocaleInterface $x, LocaleInterface $y) |
||
28 | |||
29 | /** |
||
30 | * Create a locale from a language tag (or locale code). |
||
31 | * |
||
32 | * @param string $code |
||
33 | * |
||
34 | * @return LocaleInterface |
||
35 | * @throws DomainException |
||
36 | */ |
||
37 | public static function create($code) |
||
49 | |||
50 | /** |
||
51 | * Create a locale from a language tag (or locale code). |
||
52 | * |
||
53 | * @param string[] $server The $_SERVER array |
||
54 | * @param LocaleInterface[] $available All locales supported by the application |
||
55 | * @param LocaleInterface $default Locale to show in no matching locales |
||
56 | * |
||
57 | * @return LocaleInterface |
||
58 | */ |
||
59 | public static function httpAcceptLanguage(array $server, array $available, LocaleInterface $default) |
||
100 | } |
||
101 |