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

Multi-Currency: Fix unused parameter phpcs sniffs #8655

Open
Tracked by #8436
reykjalin opened this issue Apr 17, 2024 · 0 comments
Open
Tracked by #8436

Multi-Currency: Fix unused parameter phpcs sniffs #8655

reykjalin opened this issue Apr 17, 2024 · 0 comments
Labels
focus: multi-currency 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/multi-currency/FrontendCurrencies.php
  • includes/multi-currency/Analytics.php
  • includes/multi-currency/Compatibility/WooCommerceProductAddOns.php
  • includes/multi-currency/MultiCurrency.php
  • includes/multi-currency/Compatibility/WooCommerceSubscriptions.php
  • includes/multi-currency/Settings.php
  • includes/multi-currency/SettingsOnboardCta.php
  • includes/multi-currency/Compatibility/WooCommerceNameYourPrice.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: multi-currency labels Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
focus: multi-currency 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

1 participant