Skip to content

Commit

Permalink
Handle inner PHPDoc blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
kylekatarnls committed May 9, 2020
1 parent 9d27a12 commit d54db4d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Types/Generator.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,21 @@ protected function getMethodsDefinitions($boot, $source, $defaultClass)

$length = $method->getEndLine() - 1;
$lines = $files[$methodFile];

if ($length > 3 && preg_match('/^\s*\*+\/\s*$/', $lines[$length - 2])) {
$doc = '';

for ($i = $length - 2; $i >= max(0, $length - 42); $i--) {
$doc = $lines[$i].$doc;

if (preg_match('/\s*\/\*{2,}\s*/', $lines[$i])) {
$methodDocBlock = trim($doc);

break;
}
}
}

$code = array_slice($lines, 0, $length);

for ($i = $length - 1; $i >= 0; $i--) {
Expand Down

0 comments on commit d54db4d

Please sign in to comment.