| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 2 |
| Changes | 5 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 32 | public function transform(mixed $value): mixed |
||
| 33 | 2 | { |
|
| 34 | 2 | if (null === $matches = $this->extract($value)) { |
|
| 35 | throw new \Exception(\sprintf('Unable to resolve constant %s.', $value)); |
||
| 36 | } |
||
| 37 | 2 | ||
| 38 | [$class, $constant] = $matches; |
||
| 39 | |||
| 40 | 1 | return (new \ReflectionClass($class))->getConstant($constant); |
|
| 41 | } |
||
| 59 |