-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Removed @mixin Builder
comment from Model.php
#2923
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
Conversation
Thanks for the feedback. Could you provide an example of static analysis that is broken with this change, that was not before. Thanks. |
From my POV, this annotation enables autocompletion of builder's methods in PHPStorm. |
UPDATE: @GromNaN I think I found the issue; use ...
use MongoDB\Laravel\Query\Builder as QueryBuilder;
use ... Probably PHPStorm understands that Builder is actually the QueryBuilder, but PHPStand doesn't. I changed Also updated the PR. |
That's a different class, the exposed methods are wrong with this change. I tried to reproduce with PHPStan but didn't find the bug. Try removing or changing the |
Hey @GromNaN! Yeah, sorry for the mistake, now I see it's a different class. Anyway, I can see mixin works as expected in your demo, but I can't fix my issue 🫤
By the way, I'm using Let's move the issue to Larastan 👌 |
Hey @GromNaN, sorry for bothering again. Might this be an issue on this implementation? I have no idea about these inner ways of work of stan. I'm trying to upgrade to v4.3, but the 30+ phpstan errors are keeping me away form it. |
Fixed by #2981 |
Great! |
Fix for #2922.
This change fdfb5e5#diff-284e164f76aeb13f424d154f9208d91fdbb0112b0a50ad8b1dfa237176f03cf2 introduced a breaking change for phpstan, it now wrongly infers models as
Illuminate\Database\Eloquent\Model
, instead of it's main class.Salut @GromNaN!
As the author of that change, is it necessary? Can we go back to what it was?
Checklist
Add tests and ensure they passUpdate documentation for new features