| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3.0123 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | 24 | public function supports($value): bool |
|
| 20 | { |
||
| 21 | 24 | if (!$value instanceof Closure) { |
|
| 22 | 18 | return false; |
|
| 23 | } |
||
| 24 | 20 | $reflection = new ReflectionClosure($value); |
|
| 25 | |||
| 26 | 20 | $closureReflection = $reflection->getClosureScopeClass(); |
|
| 27 | |||
| 28 | 20 | if (null === $closureReflection) { |
|
| 29 | return false; |
||
| 30 | } |
||
| 31 | |||
| 32 | 20 | $closureClassOwnerName = $closureReflection->getName(); |
|
| 33 | |||
| 34 | 20 | return is_a($closureClassOwnerName, Env::class, true); |
|
| 35 | } |
||
| 54 |