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

Ignore function call arguments on static declarations processing (#272) #273

Merged
merged 1 commit into from
Aug 15, 2022

Conversation

arkener
Copy link
Contributor

@arkener arkener commented Aug 15, 2022

Provides a fix for #272, adding the following:

  • Add check if static declaration is called from within a function call, skipping it if this is the case.
  • Add a test to check for static initializer methods, mostly calling the __construct()
  • Add a test for static closure usage.

This fix doesn't feel like a 100% fix, as the main issue seems to be that the static declaration check sometimes picks up static definitions outside of it's prospected scope. This mostly shows up with static function calls.

Fixes #272

@sirbrillig
Copy link
Owner

Thank you!

This fix doesn't feel like a 100% fix

The most important thing is that we increase the test cases as you've done here so that if things are refactored we prevent these issues from happening again.

@sirbrillig sirbrillig merged commit f0146d7 into sirbrillig:2.x Aug 15, 2022
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.

Incorrect warning for arguments to static methods that return "new static()"
2 participants