Automattic / woocommerce-subscriptions-core

Subscriptions core package for WooCommerce
Other
87 stars 32 forks source link

phpcs doesn't work on php8.0+ and this blocks commits (phpcs is a pre-commit check) #267

Open brucealdridge opened 1 year ago

brucealdridge commented 1 year ago

Describe the bug

On pre-commit hooks, phpcs is run and blocks the commit if the changes being committed doesn't match the defined code-style requirements.

When running php8+ errors are generated by phpcs which causes commits to fail.

An error occurred during processing; checking has been aborted. The error message was: trim(): Passing null to parameter #1 ($string) of type string is deprecated in woocommerce-subscriptions-core/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniff.php on line 131

To Reproduce

  1. On php8+
  2. Run composer phpcs
  3. See error

Product impact

Additional context

haszari commented 1 year ago

If this gets complex to resolve, we could remove phpcs as a pre-commit check (temporarily).