diff --git a/src/CodeVisitor.php b/src/CodeVisitor.php index 2c5f12f0..616d34ca 100644 --- a/src/CodeVisitor.php +++ b/src/CodeVisitor.php @@ -5,11 +5,13 @@ namespace Ray\Aop; use PhpParser\Node; +use PhpParser\Node\Name; use PhpParser\Node\Stmt\Class_; use PhpParser\Node\Stmt\ClassMethod; use PhpParser\Node\Stmt\Declare_; use PhpParser\Node\Stmt\Namespace_; use PhpParser\Node\Stmt\Use_; +use PhpParser\Node\Stmt\UseUse; use PhpParser\NodeVisitorAbstract; use Ray\Aop\Exception\MultipleClassInOneFileException; @@ -92,7 +94,7 @@ private function enterNodeClass(Node $node) public function addUses(array $annotations): void { foreach ($annotations as $annotation) { - $this->addUse(new Use_([new Node\Stmt\UseUse(new Node\Name(get_class($annotation)))])); + $this->addUse(new Use_([new UseUse(new Name(get_class($annotation)))])); } }