Fix unused parameter phpcs sniffs #8436
Labels
category: engineering
For product engineering, architecture work, tech debt and so on.
focus: misc or unknown
Issues that need to be added to a focus area (aka "needs focus").
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.
Description
This is a follow up to #8415 where there are some issues reported by phpcs that were not a straight-forward fix.
Running
Results in a list of issues in these files (also a command to get just the list of files)
tests/unit/subscriptions/test-class-wc-payments-subscription-service.php
tests/unit/subscriptions/test-class-wc-payments-subscriptions-event-handler.php
includes/payment-methods/class-upe-payment-method.php
tests/unit/subscriptions/test-class-wc-payments-subscriptions-migrator.php
includes/multi-currency/Analytics.php
includes/multi-currency/FrontendCurrencies.php
tests/unit/test-class-compatibility-service.php
src/Internal/Payment/State/AbstractPaymentState.php
tests/unit/multi-currency/test-class-multi-currency.php
tests/unit/test-class-wc-payments-features.php
tests/unit/helpers/class-wc-helper-product-add-ons-helper.php
includes/class-wc-payments-incentives-service.php
tests/unit/test-class-wc-payment-gateway-wcpay-payment-types.php
tests/unit/core/server/request/test-trait-order-info.php
tests/unit/helpers/class-wc-helper-subscriptions-synchroniser.php
tests/unit/multi-currency/compatibility/test-class-woocommerce-subscriptions.php
includes/class-logger.php
includes/multi-currency/MultiCurrency.php
tests/unit/multi-currency/test-class-analytics.php
tests/unit/test-class-wc-payment-gateway-wcpay-process-payment.php
includes/wc-payment-api/class-wc-payments-api-client.php
includes/admin/class-wc-payments-admin-sections-overwrite.php
tests/unit/subscriptions/test-class-wc-payments-invoice-service.php
tests/unit/test-class-wc-payment-gateway-wcpay-subscriptions-payment-method-order-note.php
tests/unit/subscriptions/test-class-wc-payments-subscription-change-payment-method.php
tests/unit/test-class-wc-payment-gateway-wcpay-subscriptions-process-payment.php
tests/unit/test-class-wc-payments-utils.php
tests/unit/test-class-wc-payment-gateway-wcpay-subscriptions.php
includes/class-wc-payments-webhook-processing-service.php
includes/class-wc-payments.php
includes/class-wc-payments-apple-pay-registration.php
tests/unit/test-class-wc-payment-gateway-wcpay.php
These seem to be mostly valid cases. I'd love to see if we can maybe add some rule to
phpcs.xml.dist
that catches these valid cases, e.g. in filters and hooks.Alternatively we could just ignore these outright. Either way we should go through all of these issues and either:
phpcs.xml.dist
.Acceptance criteria
No more issues reported by
phpcs
.Tasks
The text was updated successfully, but these errors were encountered: