Skip to content
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

Fix recognition of variable functions #27

Merged
merged 3 commits into from Feb 8, 2018

Conversation

sirbrillig
Copy link
Owner

Fixes #26

@sirbrillig sirbrillig force-pushed the fix/variable-functions-count branch 2 times, most recently from 258e5f2 to 8498bd4 Compare February 8, 2018 23:00
@sirbrillig
Copy link
Owner Author

Ok, I think I found it. It's this line from the PHP docs:

When calling static methods, the function call is stronger than the static property operator:

To be more specific,

  • Thing::$prop looks for a static variable named $prop on the class Thing.
  • Thing::$$propName looks for a static variable called whatever the value of $propName is on the class Thing.
  • $className::$prop looks for a static variable named $prop on the class called whatever the value of $className is set to.
  • Thing::func() looks for a static function called func on the class Thing.
  • Thing::$funcName() looks for a static function named whatever the value of $funcName is on the class Thing.

That last one is the odd one out, and the sniffs don't take it into account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant