Conditions | 3 |
Paths | 3 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3.0261 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | 28 | public function __construct(string $locale, int $style) |
|
21 | { |
||
22 | 28 | if (class_exists(NumberFormatter::class) === false) { |
|
23 | throw new Exception(); |
||
24 | } |
||
25 | |||
26 | 28 | $formatterLocale = str_replace('-', '_', $locale); |
|
27 | 28 | $this->formatter = new NumberFormatter($formatterLocale, $style); |
|
28 | 28 | if ($this->formatter->getLocale() !== $formatterLocale) { |
|
29 | 3 | throw new Exception("Unable to read locale data for '{$locale}'"); |
|
30 | } |
||
38 |