ThisCallOnStaticMethodToStaticCall rule useless for the Symfony assertions because the method aren't being considered as static #8829
Unanswered
florentpoujol
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello there
The Symfony
WebTestCaseclass has a traitWebTestAssertionsTraitwhich only contains 3 traits which themselves contains the assertion methods that are all static.It seems that the method
\Rector\NodeCollector\StaticAnalyzer::isStaticMethod, used by theThisCallOnStaticMethodToStaticCallrule do not detect theses methods as being static because the call to$classMethod = $class->getMethod($methodName);returns null.This render the rule (a slightly modified version that do run within PHPUnit classes) useless for theses methods.
I'm just wondering if this is a bug (because the methods are within traits probably) or something you would not consider as such.
Thanks for the answers.
Beta Was this translation helpful? Give feedback.
All reactions