Skip to content

Phpcbf command with wordpress standard throws fatal error #2199

@wpvirtuoso

Description

@wpvirtuoso

I see phpcs -standard=wordpress works fine but in the case of phpcbf it throws fatal error. It does not hapen when I use phpcbf without WordPress standard.

The issue happens when running this command:

➜ ~ phpcbf --standard=WordPress /Users/muhammadzaki/"Local Sites"/max-slider/app/public/wp-content/plugins/rex-slider/public/class-rex-slider-public.php

Error I am seeing:

PHP Fatal error: Uncaught PHP_CodeSniffer\Exceptions\RuntimeException: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /Users/muhammadzaki/wpcs/WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php on line 280 in /Users/muhammadzaki/.composer/vendor/squizlabs/php_codesniffer/src/Runner.php:604

I am using php 8.2
installed latest phpcs and wpcs from GitHub.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions