fix(php): Do not duplicate returns (#138)

This commit is contained in:
danymat
2023-05-22 13:06:58 +02:00
parent d789a5a2e0
commit de603d2f83

View File

@@ -63,6 +63,13 @@ return {
} }
local nodes = nodes_utils:matching_nodes_from(node, tree) local nodes = nodes_utils:matching_nodes_from(node, tree)
local res = extractors:extract_from_matched(nodes) 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 return res
end, end,
}, },