-
Notifications
You must be signed in to change notification settings - Fork 51
Dynamic call to static method #4
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
Comments
Hi, yes, that rule would be awesome :)
On Wed, 27 Dec 2017 at 21:30, Lukáš Unger ***@***.***> wrote:
Hi. Would there be interest in a new rule that checks that static methods
are called with :: and not with ->? I see that fairly regulary in the
wild (mainly with PHPUnit's asserts) and it's driving me crazy.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#4>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AAGZuA9HPSJymYt7SrrMHFrRoUGBNBrwks5tEqjrgaJpZM4RNyio>
.
--
Ondřej Mirtes
|
See Static vs. Non-Static Usage of Assertion Methods (PHPUnit docs). Maybe the rule should be somehow configurable to allow this special case? |
@mhujer I have read that and I agree with the statement that there is no 'right' way. But since this package contains opinionated rules, I am trying to choose the right way. If the method is declared static, it should be called statically.. As for the configurable part, I could hardcode in some check for PHPUnit and allow a parameter to control it's behavior, but it seems to defeat the purpose.. |
@mhujer I think that you can simply ignore the errors using |
PR merged :) |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi. Would there be interest in a new rule that checks that static methods are called with
::
and not with->
? I see that fairly regulary in the wild (mainly withPHPUnit
's asserts) and it's driving me crazy.The text was updated successfully, but these errors were encountered: