From c4bf74e7b0e21f9f749e8782dcabf6cfdcf6f9a1 Mon Sep 17 00:00:00 2001 From: Yurun Date: Sat, 27 Apr 2024 09:45:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Bean/Parser/BeanParser.php | 2 +- src/Components/grpc/src/Util/GrpcInterfaceManager.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Bean/Parser/BeanParser.php b/src/Bean/Parser/BeanParser.php index 52941bb65..25b7b35d3 100644 --- a/src/Bean/Parser/BeanParser.php +++ b/src/Bean/Parser/BeanParser.php @@ -66,7 +66,7 @@ public function parse(\Imi\Bean\Annotation\Base $annotation, string $className, else { $docblock = DocBlock::getDocBlock($comment, new Context($propRef->getDeclaringClass()->getNamespaceName())); - $tag = $docblock->getTagsByName('var')[0] ?? null; + $tag = $docblock->getTagsWithTypeByName('var')[0] ?? null; if ($tag) { $annotation->name = $tag->getType()->__toString(); diff --git a/src/Components/grpc/src/Util/GrpcInterfaceManager.php b/src/Components/grpc/src/Util/GrpcInterfaceManager.php index ab1ec00c4..2a9dcef49 100644 --- a/src/Components/grpc/src/Util/GrpcInterfaceManager.php +++ b/src/Components/grpc/src/Util/GrpcInterfaceManager.php @@ -95,8 +95,7 @@ public function bind($interface, ?string $serviceName = null): void else { $docblock = DocBlock::getDocBlock($docComment, new Context($interface->getNamespaceName())); - // @phpstan-ignore-next-line - $responseClass = (string) $docblock->getTagsByName('return')[0]->getType(); + $responseClass = (string) $docblock->getTagsWithTypeByName('return')[0]->getType(); } $methods[$method->getName()] = [