Skip to content

Commit e6811e9

Browse files
authored
Merge pull request #14 from JeRabix/master
add support parse generic type in docBlock
2 parents e5e1727 + 05596d7 commit e6811e9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Barryvdh/Reflection/DocBlock/Tag/ParamTag.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ public function setContent($content)
5353
PREG_SPLIT_DELIM_CAPTURE
5454
);
5555

56+
// detect generic type
57+
if (isset($parts[0]) && isset($parts[2]) && strpos($parts[0], '<') !== false && strpos($parts[2], '>') !== false) {
58+
$parts[0] .= ' ' . $parts[2];
59+
unset($parts[1]);
60+
unset($parts[2]);
61+
$parts = array_values($parts);
62+
}
63+
5664
// if the first item that is encountered is not a variable; it is a type
5765
if (isset($parts[0])
5866
&& (strlen($parts[0]) > 0)

0 commit comments

Comments
 (0)