Open
Description
Description
This is a follow up to #8415 where there are some issues reported by phpcs that were not a straight-forward fix.
Running
./vendor/bin/phpcs --standard=phpcs.xml.dist $(git ls-files | grep '.php$') --sniffs='VariableAnalysis.CodeAnalysis.VariableAnalysis'
Results in a list of issues in these files (also a command to get just the list of files)
./vendor/bin/phpcs --standard=phpcs.xml.dist $(git ls-files | grep '.php$') --sniffs='VariableAnalysis.CodeAnalysis.VariableAnalysis' | rg 'FILE' | sed 's/FILE: \/path\/to\/wcpay\/repo\/parent\/woocommerce-payments\//* '
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:
- Fix the issue, if it exists;
- Add ignores in-place via comments; or
- Add an ignore to
phpcs.xml.dist
.
Acceptance criteria
No more issues reported by phpcs
.