| Total Complexity | 8 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class FloatElement extends LeafElement |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * {@inheritdoc} |
||
| 18 | * |
||
| 19 | * @return float|null |
||
| 20 | */ |
||
| 21 | 32 | protected function toPhp($httpValue): ?float |
|
| 22 | { |
||
| 23 | 32 | return $httpValue === null || $httpValue === '' ? null : (float) $httpValue; |
|
|
|
|||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * {@inheritdoc} |
||
| 28 | */ |
||
| 29 | 9 | protected function toHttp($phpValue): ?string |
|
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * {@inheritdoc} |
||
| 36 | * |
||
| 37 | * @return float|null |
||
| 38 | */ |
||
| 39 | 19 | protected function tryCast($value): ?float |
|
| 50 | } |
||
| 51 | } |
||
| 52 |