-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
Macro implements MethodReflection instead of BuiltinMethodReflection #298
Conversation
5f12f2d
to
3138f23
Compare
3138f23
to
dbe3bf7
Compare
@nunomaduro What do you think? I think it's working. |
I'm also fixing #291 here. |
a1a233e
to
92f808a
Compare
Blindly trusting you on this. 😅 |
@ondrejmirtes Shouldn't we bump the required phpstan version? |
@nunomaduro I'm getting the following exceptions after updating:
Seems to be caused by stuff like: Route::bind('myModel', static function (string $uuid): MyModel {
return MyModel::onlyTrashed()->where('uuid', $uuid)->firstOrFail();
// no difference if used:
return MyModel::query()->onlyTrashed()->where('uuid', $uuid)->firstOrFail();
}); |
Not necessary to bump PHPStan version. I'm gonna look into the exception, maybe I screwed up. |
I haven't realized that |
This is fix for PHPStan 0.11.14. This PR changes what interface
Macro
implements, and some additonal cleanups stem from that.This is closer to how PHPStan extensions should work. It's better to implement
MethodReflection
in a class directly rather than pass it through PhpMethodReflectionFactory.I'm sorry about these BC breaks, it didn't occur to me that some extensions would be using the
BuiltinMethodReflection
interface. I want to have much clearer backwards compatibility boundary in the future, probably by tagging some classes and interfaces with@api
. Everything else will be considered internal.Right now, the rule of thumb is that backwards compatibility covers what's mentioned in the README.