| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | 7 | public function __construct( |
|
| 26 | public int|float|string|null $number = null, |
||
| 27 | public ?string $locale = null, |
||
| 28 | public int $style = NumberFormatter::DECIMAL, |
||
| 29 | public ?string $pattern = null, |
||
| 30 | public int $fraction_digits = 2 |
||
| 31 | ) { |
||
| 32 | 7 | $this->locale = $this->locale ?? app()->getLocale(); |
|
|
|
|||
| 33 | |||
| 34 | 7 | $this->formatter = new NumberFormatter( |
|
| 35 | 7 | $this->locale, |
|
| 36 | 7 | $this->style, |
|
| 37 | 7 | $this->pattern |
|
| 38 | ); |
||
| 39 | |||
| 40 | 7 | $this->formatter->setAttribute( |
|
| 41 | NumberFormatter::FRACTION_DIGITS, |
||
| 42 | 7 | $this->fraction_digits |
|
| 43 | ); |
||
| 60 |