| Total Complexity | 4 |
| Total Lines | 16 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 19 | final class ClassVisitor extends NodeVisitorAbstract |
||
| 20 | { |
||
| 21 | public function __construct(private readonly ClassDefinitionBuilder $builder, private readonly Codebase $codebase) |
||
|
|
|||
| 22 | { |
||
| 23 | } |
||
| 24 | |||
| 25 | public function leaveNode(Node $node) |
||
| 26 | { |
||
| 27 | if (! $node instanceof Class_) { |
||
| 28 | return null; |
||
| 29 | } |
||
| 30 | if ($node->isAnonymous()) { |
||
| 31 | return null; |
||
| 32 | } |
||
| 33 | $this->codebase->add($this->builder->build($node)); |
||
| 34 | return null; |
||
| 35 | } |
||
| 37 |