| Total Complexity | 5 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 10 | class FloatFormatter implements Formatter |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @param int|float|string|null $value The value to format. |
||
| 14 | * @param string|null $decimal_separator The decimal separator to use for formatting. |
||
| 15 | */ |
||
| 16 | 5 | public function __construct( |
|
| 20 | 5 | } |
|
| 21 | |||
| 22 | /** |
||
| 23 | * Get the valid decimal separator or null. |
||
| 24 | * |
||
| 25 | * @param string|null $decimal_separator The decimal separator to convert. |
||
| 26 | * @return string|null The valid decimal separator or null. |
||
| 27 | */ |
||
| 28 | 5 | private function getDecimalSeparator(?string $decimal_separator): ?string |
|
| 37 | } |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Format the value as a float using the specified decimal separator. |
||
| 42 | * |
||
| 43 | * @return float The formatted float value. |
||
| 44 | */ |
||
| 45 | 5 | public function format(): float |
|
| 50 |