From 05596d7626c1bcef7e8a6519d2afa4c8f7c3d23e Mon Sep 17 00:00:00 2001 From: Murchenko Date: Thu, 13 Apr 2023 22:42:48 +0300 Subject: [PATCH] add support parse generic type in docBlock --- src/Barryvdh/Reflection/DocBlock/Tag/ParamTag.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Barryvdh/Reflection/DocBlock/Tag/ParamTag.php b/src/Barryvdh/Reflection/DocBlock/Tag/ParamTag.php index d9a13614..78c5aa52 100644 --- a/src/Barryvdh/Reflection/DocBlock/Tag/ParamTag.php +++ b/src/Barryvdh/Reflection/DocBlock/Tag/ParamTag.php @@ -53,6 +53,14 @@ public function setContent($content) PREG_SPLIT_DELIM_CAPTURE ); + // detect generic type + if (isset($parts[0]) && isset($parts[2]) && strpos($parts[0], '<') !== false && strpos($parts[2], '>') !== false) { + $parts[0] .= ' ' . $parts[2]; + unset($parts[1]); + unset($parts[2]); + $parts = array_values($parts); + } + // if the first item that is encountered is not a variable; it is a type if (isset($parts[0]) && (strlen($parts[0]) > 0)