This repository was archived by the owner on Feb 23, 2024. It is now read-only.
This repository was archived by the owner on Feb 23, 2024. It is now read-only.
npm run lint:php
command doesn't work on PHP 8.x #11834
Open
Description
Describe the bug
Currently, the current version of woocommerce-sniffs
isn't compatible with the PHP 8.x version. If you run the command npm run lint:php
with PHP 8.x, you have this error for each .PHP file:
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | 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
| | /Users/gigitux/work/woocommerce-blocks/vendor/wp-coding-standards/wpcs/WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php on line 280 (Internal.Exception)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
We are already working on upgrading woocommerce-sniffs
with #11724.
To reproduce
Steps to reproduce the behavior:
- Ensure that you are using PHP 8.x.
- Run
npm run lint:php
. - See the errors.