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

Do not trigger UnusedFormalParameter with some magic methods #219

Merged
merged 3 commits into from
Nov 10, 2014

Conversation

fabre-thibaud
Copy link

PHPMD incorrectly detects some parameters as unused for magic methods (ie. __call), but it is not possible to remove them from the signature since they are required by PHP.

This P/R makes the UnusedFormalParameter ignore parameters for magic methods with the following names:

  • __call
  • __callStatic
  • __get
  • __set
  • __isset
  • __unset
  • __set_state

The functions have been filtered using two criterias, first one being that they have at least one argument, second that the signature is dictated by PHP and implementations cannot remove the parameters from the signature even when unused.

manuelpichler added a commit that referenced this pull request Nov 10, 2014
Do not trigger UnusedFormalParameter with some magic methods
@manuelpichler manuelpichler merged commit fcb6735 into phpmd:master Nov 10, 2014
@ravage84 ravage84 added this to the 2.2.0 milestone Jul 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants