Skip to content

Commit 6b69015

Browse files
authored
Merge pull request #2 from JeppeKnockaert/add-brackets-for-parsing-return-types
feature - Improve method tag parsing
2 parents 64165bd + 053005e commit 6b69015

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,15 @@ public function setContent($content)
7676
)?
7777
# Return type
7878
(?:
79-
([\w\|_\\\\]+)
79+
(
80+
(?:[\w\|_\\\\]*\$this[\w\|_\\\\]*)
81+
|
82+
(?:
83+
(?:[\w\|_\\\\]+)
84+
# array notation
85+
(?:\[\])*
86+
)*
87+
)
8088
\s+
8189
)?
8290
# Legacy method name (not captured)

0 commit comments

Comments
 (0)