Skip to content

[Bug]: _model_helpers file sets "find" return type to "stdClass|null" #573

@craigrileyuk

Description

@craigrileyuk

Extension Version

1.5.1

PHP Binary

Herd

Operating System

macOS

What happened?

Whenever I use the find method on an Eloquent model, the return type is set to stdClass|null which causes using any further methods/properties to throw up an IDE error.

Mimimal Code Sample

In my `vendor/_laravel_ide/_model_helpers.php` file, all my models have this PHPDoc attribute:

* @method static \stdClass|null find(int|string $id, string|\Illuminate\Contracts\Database\Query\Expression|(string|\Illuminate\Contracts\Database\Query\Expression)[] $columns)

which is causing VSCode to treat `$model = SomeModel::find(1);` as a stdClass object.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions