laravel-ide-helper icon indicating copy to clipboard operation
laravel-ide-helper copied to clipboard

Fix return type of methods provided by `SoftDeletes`

Open KentarouTakeda opened this issue 3 years ago • 1 comments

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

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

Checklist

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

KentarouTakeda avatar Apr 28 '22 13:04 KentarouTakeda

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

mfn avatar Apr 28 '22 18:04 mfn

@barryvdh @mfn Thank you for review and merge!

KentarouTakeda avatar Aug 11 '22 23:08 KentarouTakeda