| Total Complexity | 4 |
| Total Lines | 19 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | final class IntType implements TypeCastInterface |
||
| 10 | { |
||
| 11 | 34 | public function __construct(private string $value) |
|
| 12 | { |
||
| 13 | } |
||
| 14 | |||
| 15 | 34 | public function isPossible(): bool |
|
| 16 | { |
||
| 17 | 34 | $this->value = preg_replace('/^(\*int\s*)/', '', $this->value); |
|
| 18 | |||
| 19 | 34 | if (is_numeric($this->value)) { |
|
| 20 | 16 | return (string)(int)$this->value === $this->value; |
|
| 21 | } |
||
| 22 | 26 | return false; |
|
| 23 | } |
||
| 24 | |||
| 25 | 13 | public function getCastedValue(): int |
|
| 28 | } |
||
| 29 | } |
||
| 30 |