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

Payments: Fix unused parameter phpcs sniffs #8658

Closed
Tracked by #8436
reykjalin opened this issue Apr 17, 2024 · 1 comment
Closed
Tracked by #8436

Payments: Fix unused parameter phpcs sniffs #8658

reykjalin opened this issue Apr 17, 2024 · 1 comment
Assignees
Labels
focus: payments acceptance & processing priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: technical debt This issue/PR represents/solves the technical debt of the project.

Comments

@reykjalin
Copy link
Contributor

reykjalin commented Apr 17, 2024

Part of #8436.

Description

Remove the VariableAnalysis.CodeAnalysis.VariableAnalysis exclude from phpcs.xml.dist and fix the issues reported when running npm run lint:php in the following files:

  • includes/admin/class-wc-rest-payments-transactions-controller.php

Suggested fixes:

  • When a variable is truly unused, such as in filter functions where a parameter isn’t needed, prepend $_unused_ to the variable name. For example $order$_unused_order.
  • If a variable is not necessary, remove it.
  • When a parent class/interface doesn’t use a parameter but child classes do, use an inline // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable.
@reykjalin reykjalin added priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: technical debt This issue/PR represents/solves the technical debt of the project. focus: payments acceptance & processing labels Apr 17, 2024
@zmaglica zmaglica self-assigned this Jan 10, 2025
@zmaglica
Copy link
Contributor

Addressed in #10131

@mgascam mgascam added this to the WooPayments 8.9.0 milestone Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: payments acceptance & processing priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: technical debt This issue/PR represents/solves the technical debt of the project.
Projects
None yet
Development

No branches or pull requests

3 participants