| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 22 | public function handle(LocaleUpdated $event) |
|
| 19 | { |
||
| 20 | 22 | $supportedLocale = $this->localization->getSupportedLocale($event->locale); |
|
| 21 | 22 | $constants = collect($supportedLocale->get('constants', [])); |
|
| 22 | 22 | $regionalCode = $supportedLocale->get('regional_code'); |
|
| 23 | 22 | $charset = $supportedLocale->get('charset', false); |
|
| 24 | |||
| 25 | 22 | $localeCode = $charset ? "$regionalCode.$charset" : $regionalCode; |
|
| 26 | |||
| 27 | $constants->each(function ($constant) use ($localeCode) { |
||
| 28 | 22 | setlocale(constant($constant), $localeCode); |
|
| 29 | 22 | }); |
|
| 30 | 22 | } |
|
| 31 | } |
||
| 32 |