| Total Complexity | 1 |
| Total Lines | 58 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class LocaleNumberFormatter implements Formatter |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * "Locale" key to pass to the collection of $items. |
||
| 15 | * |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | public string $locale_key = 'locale'; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * "Number" key to pass to the collection of $items. |
||
| 22 | * |
||
| 23 | * @var string |
||
| 24 | */ |
||
| 25 | public string $number_key = 'number'; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * "Style" key to pass to the collection of $items. |
||
| 29 | * |
||
| 30 | * @var string |
||
| 31 | */ |
||
| 32 | public string $style_key = 'style'; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Extendable fraction digits. |
||
| 36 | * |
||
| 37 | * @var int |
||
| 38 | */ |
||
| 39 | public int $fraction_digits = 2; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Default number if $number_key isn't passed. |
||
| 43 | * |
||
| 44 | * @var float |
||
| 45 | */ |
||
| 46 | public float $default_number = 0; |
||
| 47 | |||
| 48 | /** |
||
| 49 | * Format the date and time. |
||
| 50 | * |
||
| 51 | * @param Collection $items |
||
| 52 | * |
||
| 53 | * @return string |
||
| 54 | */ |
||
| 55 | 2 | public function format(Collection $items): string |
|
| 72 |