From 151e3b96fd65147446cfec2ca10e7ada1bde7eb1 Mon Sep 17 00:00:00 2001 From: tsuchiya Date: Mon, 21 Feb 2022 21:04:47 +0900 Subject: [PATCH] Fix namespace --- src/CodeVisitor.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)))])); } }