Closed ennorehling closed 8 months ago
Thanks for the PR. I'm doing some open source work later this week to prep for the Laravel 11 release, so will look at getting this merged and tagged then.
@ennorehling thanks for this PR - I've pushed some additional changes that were missed.
Under semver, this is a major change. If anyone has extended these classes, changing the return type like this could cause their code to break.
As I'm about to do a major release for Laravel 11, I'm going to include it in that release.
When a method returns $this, it should be declared with a return type of self, especially on an interface or trait.
This makes static analysis tools like phan happy.