diff --git a/packages/BetterPhpDocParser/Attributes/Ast/AttributeAwareNodeFactory.php b/packages/BetterPhpDocParser/Attributes/Ast/AttributeAwareNodeFactory.php index b24a1ae2827f..2e64f5519304 100644 --- a/packages/BetterPhpDocParser/Attributes/Ast/AttributeAwareNodeFactory.php +++ b/packages/BetterPhpDocParser/Attributes/Ast/AttributeAwareNodeFactory.php @@ -55,7 +55,7 @@ public function createFromNode(Node $node, string $docContent): Node $node = $this->phpDocNodeTraverser->traverseWithCallable($node, $docContent, function ( Node $node, string $docContent - ) { + ): Node { if ($node instanceof UnionTypeNode && ! $node instanceof AttributeAwareUnionTypeNode) { return new AttributeAwareUnionTypeNode($node->types, $docContent); }