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