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