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