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 46b4c71
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Console/ModelsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,13 @@ protected function createPhpDocs($class)
continue;
}
$arguments = implode(', ', $method['arguments']);
$tagLine = "@method static {$method['type']} {$name}({$arguments})";

if (method_exists(\Illuminate\Database\Eloquent\Model::class, $name)) {
$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 46b4c71

Please sign in to comment.