Skip to content

Commit e278120

Browse files
committed
Changed DocBlock preparation code to also support
potentially broken syntax constructs lagging the *
1 parent 6a5fad0 commit e278120

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/docblock/Parser.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,11 @@ public function parse($block, array $aliasMap) {
9292
}
9393

9494
protected function prepare($block) {
95-
$block = str_replace(array("\r\n", "\r"), "\n", mb_substr($block, 2, -2));
95+
$block = str_replace(array("\r\n", "\r"), "\n", mb_substr($block, 3, -2));
9696
$raw = array();
9797
foreach(explode("\n", $block) as $line) {
98-
$raw[] = mb_substr(trim($line, " \n\t"), 2) ?: '';
98+
$line = preg_replace('/^\s*\* ?/', '', $line);
99+
$raw[] = rtrim($line, " \n\t*");
99100
}
100101
return $raw;
101102
}

0 commit comments

Comments
 (0)