| Total Complexity | 8 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class IntegerElement extends LeafElement |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * {@inheritdoc} |
||
| 18 | */ |
||
| 19 | 75 | protected function toPhp($httpValue): ?int |
|
| 20 | { |
||
| 21 | 75 | return $httpValue === null || $httpValue === '' ? null : (int) $httpValue; |
|
|
|
|||
| 22 | } |
||
| 23 | |||
| 24 | /** |
||
| 25 | * {@inheritdoc} |
||
| 26 | */ |
||
| 27 | 22 | protected function toHttp($phpValue): ?string |
|
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * {@inheritdoc} |
||
| 34 | */ |
||
| 35 | 31 | protected function tryCast($value): ?int |
|
| 48 |