Skip to content

Commit d2f1941

Browse files
committed
fix: cant auto complete method chaining
1 parent 8eab699 commit d2f1941

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/Console/ModelsCommand.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,19 @@ protected function createPhpDocs($class)
932932
continue;
933933
}
934934
$arguments = implode(', ', $method['arguments']);
935-
$tagLine = "@method static {$method['type']} {$name}({$arguments})";
935+
936+
$staticMethodNames = [
937+
'newQuery',
938+
'query',
939+
'newModelQuery',
940+
];
941+
942+
if (in_array($name, $staticMethodNames)) {
943+
$tagLine = "@method static {$method['type']} {$name}({$arguments})";
944+
} else {
945+
$tagLine = "@method {$method['type']} {$name}({$arguments})";
946+
}
947+
936948
if ($method['comment'] !== '') {
937949
$tagLine .= " {$method['comment']}";
938950
}

0 commit comments

Comments
 (0)