Add BrowserKitAssertionTraitReturnTypeExtension#452
Add BrowserKitAssertionTraitReturnTypeExtension#452ondrejmirtes merged 4 commits intophpstan:2.0.xfrom
Conversation
24d7802 to
c7e1125
Compare
| */ | ||
| private function isSupported(Expr $expr, Scope $scope): bool | ||
| { | ||
| if (!($expr instanceof MethodCall) || !($expr->name instanceof Identifier) || $expr->name->name !== self::TRAIT_METHOD_NAME) { |
There was a problem hiding this comment.
I don't understand the logic. You're interested in the method name and you're interested where we're calling it from.
But you're not interested on what we're calling the method. This extension might be influencing a total coincidence that's nothing to do with BrowserKitAssertionsTrait::getClient().
We're in a class, the class has getClient method. And the method is declared in BrowserKitAssertionsTrait trait. But the method we're still calling might be unrelated.
My hunch is telling me you're no checking $scope->getMethodReflection($scope->getType($expr->var), $expr->name->name) but you should be.
Also, method names are case-insensitive, so toLowerString() needs to happen.
There was a problem hiding this comment.
I copied the logic from the extension you gave me as example
So I assume it should be improve on the other extension too.
9a6e442 to
2b57a14
Compare
|
I tried to fix both BrowserKitAssertionTraitReturnTypeExtension and MessengerHandleTraitReturnTypeExtension then @ondrejmirtes |
|
Friendly ping if you have time for a new look @ondrejmirtes |
2b57a14 to
eeed901
Compare
|
Thank you! |
No description provided.