1 | <?php |
||
5 | abstract class Intl |
||
6 | { |
||
7 | /** |
||
8 | * Get the current locale. |
||
9 | * |
||
10 | * @return string |
||
11 | */ |
||
12 | abstract public function getLocale(); |
||
13 | |||
14 | /** |
||
15 | * Set the current locale. |
||
16 | * |
||
17 | * @param $locale |
||
18 | * @return $this |
||
19 | */ |
||
20 | abstract public function setLocale($locale); |
||
21 | |||
22 | /** |
||
23 | * Get the fallback locale. |
||
24 | * |
||
25 | * @return string |
||
26 | */ |
||
27 | abstract public function getFallbackLocale(); |
||
28 | |||
29 | /** |
||
30 | * Set the fallback locale. |
||
31 | * |
||
32 | * @param $locale |
||
33 | * @return $this |
||
34 | */ |
||
35 | abstract public function setFallbackLocale($locale); |
||
36 | |||
37 | /** |
||
38 | * Run the given callable while using another locale. |
||
39 | * |
||
40 | * @param string $locale |
||
41 | * @param callable $callback |
||
42 | * @param string|null $fallbackLocale |
||
43 | * @return mixed |
||
44 | */ |
||
45 | 15 | public function usingLocale($locale, callable $callback, $fallbackLocale = null) |
|
60 | } |