| Conditions | 5 |
| Paths | 9 |
| Total Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | 12 | public function visitClass(Class_ $node) { |
|
| 14 | 12 | $struct = $this->getStruct(); |
|
| 15 | |||
| 16 | 12 | if ($node->extends !== null) { |
|
| 17 | 4 | if ($node->extends->getType() === 'Name_FullyQualified') { |
|
| 18 | 2 | $struct->setParentClassName('\\' . implode('\\', $node->extends->parts)); |
|
| 19 | } else { |
||
| 20 | 2 | $struct->setParentClassName(implode('\\', $node->extends->parts)); |
|
| 21 | } |
||
| 22 | } |
||
| 23 | |||
| 24 | 12 | foreach ($node->implements as $interface) { |
|
| 25 | 4 | if ($interface->getType() === 'Name_FullyQualified') { |
|
| 26 | 2 | $struct->addInterface('\\' . implode('\\', $interface->parts)); |
|
| 27 | } else { |
||
| 28 | 2 | $struct->addInterface(implode('\\', $interface->parts)); |
|
| 29 | } |
||
| 30 | } |
||
| 31 | |||
| 32 | 12 | $struct->setAbstract($node->isAbstract()); |
|
| 33 | 12 | $struct->setFinal($node->isFinal()); |
|
| 34 | 12 | } |
|
| 35 | } |
||
| 36 |