Skip to content

Commit

Permalink
Merge pull request #14 from JeRabix/master
Browse files Browse the repository at this point in the history
add support parse generic type in docBlock
  • Loading branch information
barryvdh authored Jun 14, 2023
2 parents e5e1727 + 05596d7 commit e6811e9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Barryvdh/Reflection/DocBlock/Tag/ParamTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e6811e9

Please sign in to comment.