From 381d41d63805b6e18d344443a269416511ed13bd Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Sun, 18 Feb 2024 13:28:36 +0100 Subject: [PATCH] Filter duplicate properties --- src/Console/ModelsCommand.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index fafa52a..55bc717 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -1004,6 +1004,14 @@ class ModelsCommand extends Command } } + $tags = collect($tags)->unique(function (Tag $tag) { + if (method_exists($tag, 'getVariableName')) { + return $tag->getName() . ' ' . $tag->getVariableName(); + } + return (string) $tag; + + })->toArray(); + $phpdoc = new DocBlock($summary ?: '', $description, $tags, $phpDocContext); $docComment = $serializer->getDocComment($phpdoc);