Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix return type of methods provided by SoftDeletes #1345

Merged
merged 4 commits into from
Aug 11, 2022
Merged

Fix return type of methods provided by SoftDeletes #1345

merged 4 commits into from
Aug 11, 2022

Conversation

KentarouTakeda
Copy link
Contributor

@KentarouTakeda KentarouTakeda commented Apr 28, 2022

Summary

Fix return type of methods provided by SoftDeletes.

Detail

The SoftDeletes model has three methods available:

As the linked code shows, they return \Illuminate\Database\Eloquent\Builder, but theide-helper:models command generates the annotation \Illuminate\Database\Query\Builder. I fixed this difference.

Notice

Previously there were no issues, but with the fix for Laravel v9.3.0 , some static analysis tools such as PHPStan now report errors in the traditional ide-helper process.

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • Existing tests have been adapted and/or new tests have been added
  • Add a CHANGELOG.md entry
  • Update the README.md
  • Code style has been fixed via composer fix-style

@mfn
Copy link
Collaborator

mfn commented Apr 28, 2022

Makes sense I think, not sure why originally it was Query, maybe @max-matiukhin remembers? :)

@barryvdh barryvdh merged commit 07f5eae into barryvdh:master Aug 11, 2022
@KentarouTakeda KentarouTakeda deleted the fix-return-type-of-softdeletes-methods branch August 11, 2022 13:14
@KentarouTakeda
Copy link
Contributor Author

@barryvdh @mfn Thank you for review and merge!

ppmathis pushed a commit to ppmathis/laravel-ide-helper that referenced this pull request Nov 12, 2022
* Fix return type of methods provided by `SoftDeletes`

* Update CHANGELOG

* fix test / update snapshot
d3v2a pushed a commit to d3v2a/laravel-ide-helper that referenced this pull request Feb 16, 2024
* Fix return type of methods provided by `SoftDeletes`

* Update CHANGELOG

* fix test / update snapshot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants