| Conditions | 5 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 5 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | 7 | public function apply(AbstractNode $node) |
|
| 19 | { |
||
| 20 | 7 | $classReferences = $node->findChildrenOfType('ClassReference'); |
|
| 21 | |||
| 22 | 7 | if ('__construct' !== $node->getImage() || 0 === count($classReferences)) { |
|
| 23 | 7 | 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 |