Conditions | 5 |
Paths | 4 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
18 | 23 | public function apply(AbstractNode $node) |
|
19 | { |
||
20 | 23 | $classReferences = $node->findChildrenOfType('ClassReference'); |
|
21 | |||
22 | 23 | if ('__construct' !== $node->getImage() || 0 === count($classReferences)) { |
|
23 | 23 | return; |
|
24 | } |
||
25 | |||
26 | 1 | $allowedClassNames = explode($this->getStringProperty('delimiter'), $this->getStringProperty('allowedClassNames')); |
|
27 | |||
28 | 1 | foreach ($classReferences as $classReference) { |
|
29 | 1 | if (false === $this->containsClassName($classReference->getImage(), $allowedClassNames)) { |
|
30 | 1 | $this->addViolation($classReference); |
|
31 | 1 | } |
|
32 | 1 | } |
|
33 | 1 | } |
|
34 | |||
52 |