Skip to content

Commit

Permalink
fix: cant auto complete method chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
SocolaDaiCa committed Feb 20, 2024
1 parent 8eab699 commit d2f1941
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Console/ModelsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,19 @@ protected function createPhpDocs($class)
continue;
}
$arguments = implode(', ', $method['arguments']);
$tagLine = "@method static {$method['type']} {$name}({$arguments})";

$staticMethodNames = [
'newQuery',
'query',
'newModelQuery',
];

if (in_array($name, $staticMethodNames)) {
$tagLine = "@method static {$method['type']} {$name}({$arguments})";
} else {
$tagLine = "@method {$method['type']} {$name}({$arguments})";
}

if ($method['comment'] !== '') {
$tagLine .= " {$method['comment']}";
}
Expand Down

0 comments on commit d2f1941

Please sign in to comment.