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

PHPCS: Enable UnusedFunctionParameter sniff #911

Merged
merged 7 commits into from
Oct 4, 2024

Conversation

obenland
Copy link
Member

Proposed changes:

  • Removes unused function parameters and their docs.
  • Adds a unit test for at_title shortcode to make sure that still works.
  • Removes sniff exception.

See #905.

@obenland obenland added php Pull requests that update Php code [Type] Janitorial labels Sep 29, 2024
@obenland obenland self-assigned this Sep 29, 2024
@obenland obenland changed the title Fix/unused function parameter sniff PHPCS: Enable UnusedFunctionParameter sniff Sep 29, 2024
@pfefferle
Copy link
Member

pfefferle commented Sep 30, 2024

won't that result in at least PHP warnings, because the functions are always called with these params, if they are used or not?

@obenland
Copy link
Member Author

Yeah, maybe this needs a different approach

@obenland
Copy link
Member Author

obenland commented Oct 3, 2024

@pfefferle Can you double-check? I think they should just be ignored. I've also not been able to generate a warning in my testing.

@pfefferle
Copy link
Member

OK, the shortcode API says:

Three parameters are passed to the shortcode callback function. You can choose to use any number of them including none of them.

@obenland obenland merged commit 2538a2f into trunk Oct 4, 2024
21 checks passed
@obenland obenland deleted the fix/UnusedFunctionParameter-sniff branch October 4, 2024 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
php Pull requests that update Php code [Type] Janitorial
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants