1 | <?php |
||
11 | class Locales implements Arrayable, ArrayAccess |
||
12 | { |
||
13 | /** |
||
14 | * @var ConfigContract |
||
15 | */ |
||
16 | protected $config; |
||
17 | |||
18 | /** |
||
19 | * @var TranslatorContract |
||
20 | */ |
||
21 | protected $translator; |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $locales = []; |
||
27 | |||
28 | public function __construct(ConfigContract $config, TranslatorContract $translator) |
||
35 | |||
36 | public function load(): void |
||
57 | |||
58 | public function all(): array |
||
62 | |||
63 | public function current() |
||
67 | |||
68 | public function has(string $locale): bool |
||
72 | |||
73 | public function get(string $locale): ?string |
||
77 | |||
78 | public function add(string $locale): void |
||
82 | |||
83 | public function forget(string $locale): void |
||
87 | |||
88 | public function getLocaleSeparator(): string |
||
92 | |||
93 | public function getCountryLocale(string $locale, string $country): string |
||
97 | |||
98 | public function isLocaleCountryBased(string $locale): bool |
||
102 | |||
103 | public function getLanguageFromCountryBasedLocale(string $locale): string |
||
107 | |||
108 | public function toArray(): array |
||
112 | |||
113 | public function offsetExists($key): bool |
||
117 | |||
118 | public function offsetGet($key): ?string |
||
122 | |||
123 | public function offsetSet($key, $value) |
||
131 | |||
132 | public function offsetUnset($key) |
||
136 | } |
||
137 |