| Conditions | 4 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 66 | protected function isTargeted(\ReflectionEnum $enum, \ReflectionClass $target = null): bool |
||
| 67 | { |
||
| 68 | if (empty($target)) { |
||
| 69 | return true; |
||
| 70 | } |
||
| 71 | |||
| 72 | if (! $target->isTrait()) { |
||
| 73 | //Target is interface or class |
||
| 74 | return $enum->isSubclassOf($target) || $enum->getName() === $target->getName(); |
||
| 75 | } |
||
| 76 | |||
| 77 | // Checking using traits |
||
| 78 | return \in_array($target->getName(), $this->fetchTraits($enum->getName())); |
||
| 79 | } |
||
| 81 |