psalm / psalm-plugin-laravel

A Psalm plugin for Laravel
MIT License
307 stars 72 forks source link

Eloquent\Builder::find() may return null #200

Closed caugner closed 3 years ago

caugner commented 3 years ago

Describe the bug

Laravel: https://github.com/laravel/framework/blob/6216534f14c7cb8bdfa213e5f7e3d357119a4579/src/Illuminate/Database/Eloquent/Builder.php#L377-L391

Plugin: https://github.com/psalm/psalm-plugin-laravel/blob/51879f2c0ed0f32766a18e8d27e6ba71650331dd/stubs/EloquentBuilder.stubphp#L118-L124

Impacted Versions

barryvdh/laravel-ide-helper           v2.9.1    Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.
laravel/framework                     v8.61.0   The Laravel Framework.
psalm/plugin-laravel                  v1.5.1    A Laravel plugin for Psalm
spatie/laravel-ray                    1.25.2    Easily debug Laravel apps
vimeo/psalm                           4.10.0    A static analysis tool for finding errors in PHP applications

Additional context Will submit a PR in a minute.