From de603d2f83a8eea7d799cc3e7a61ae02eb192110 Mon Sep 17 00:00:00 2001 From: danymat Date: Mon, 22 May 2023 13:06:58 +0200 Subject: [PATCH] fix(php): Do not duplicate returns (#138) --- lua/neogen/configurations/php.lua | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lua/neogen/configurations/php.lua b/lua/neogen/configurations/php.lua index e32b93f..b808b2c 100644 --- a/lua/neogen/configurations/php.lua +++ b/lua/neogen/configurations/php.lua @@ -63,6 +63,13 @@ return { } local nodes = nodes_utils:matching_nodes_from(node, tree) local res = extractors:extract_from_matched(nodes) + + -- "Return" tag MUST NOT occur more than once in a PHPDoc + if res[i.Return] and #res[i.Return] > 1 then + res[i.Return] = { res[i.Return][1] } + end + + return res end, },