Skip to content
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
@gigitux

Description

@gigitux

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:

  1. Ensure that you are using PHP 8.x.
  2. Run npm run lint:php.
  3. See the errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: staleStale issues and PRs have had no updates for 60 days.team: Kirigami & Origamitype: cooldownThings that are queued for a cooldown period (assists with planning).type: dependenciesPull requests that update a dependency file (used by renovate).

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions