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
ExtendedMethodReflection #1403
ExtendedMethodReflection #1403
Conversation
29c2e61
to
f859ed5
Compare
FYI @canvural I'm getting this error in Larastan:
But I don't think I'm doing a BC break here and I don't think you need to do this: if ($methodReflection instanceof EloquentBuilderMethodReflection) {
$methodReflection = $methodReflection->getOriginalMethodReflection();
} I think you can continue passing yours |
@ondrejmirtes Thanks, I'll take a look. |
This was a little bit of BC break I guess. Because previously extensions could return any class that implements Temporarily I solved this by making |
Larastan does this:
So |
Honestly no idea! I'll try to dig deeper when I have time. |
So that's the root cause here - |
If that was the case I'd use the original method reflection directly I guess. There are some differences. For example return type can be different between the original method reflection and |
FYI @rvanvelzen @jrmajor This is my answer to have we can extend what method can tell us about themselves without breaking backward compatibility.
Right now MethodReflection is being used in custom MethodsClassReflectionExtension so we can't add new methods on it. But that doesn't prevent us to work with ExtendedMethodReflection in PHPStan internals.
I imagine that methods like
acceptsNamedArguments()
andgetAsserts()
could be added on ExtendedMethodReflection.