| Conditions | 3 |
| Paths | 3 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | public function supports(mixed $value): bool |
||
| 14 | { |
||
| 15 | if (!\is_string($value)) { |
||
| 16 | return false; |
||
| 17 | 5 | } |
|
| 18 | |||
| 19 | 5 | $matches = []; |
|
|
|
|||
| 20 | 1 | ||
| 21 | if (null === $matches = $this->extract($value)) { |
||
| 22 | return false; |
||
| 23 | 4 | } |
|
| 24 | |||
| 25 | 4 | [$class, $constant] = $matches; |
|
| 26 | 1 | ||
| 27 | $constants = (new \ReflectionClass($class))->getConstants(); |
||
| 28 | |||
| 29 | 3 | return \array_key_exists($constant, $constants); |
|
| 30 | 1 | } |
|
| 59 |