Automattic / _s

Hi. I'm a starter theme called _s, or underscores, if you like. I'm a theme meant for hacking so don't use me as a Parent Theme. Instead try turning me into the next, most awesome, WordPress theme out there. That's what I'm here for.
http://underscores.me/
GNU General Public License v2.0
10.92k stars 3.12k forks source link

PHPCS not using version number specified by testVersion #1541

Open mikes000 opened 1 year ago

mikes000 commented 1 year ago

I am running into an issue where running composer lint:wpc is returning errors for PHP version 5.2 and earlier.

Error I recieve:

$ composer lint:wpc
> @php ./vendor/squizlabs/php_codesniffer/bin/phpcs
....E.. 7 / 7 (100%)
FOUND 5 ERRORS AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------------------
  8 | ERROR | "namespace" keyword is not present in PHP version 5.2 or earlier
    |       | (PHPCompatibility.Keywords.NewKeywords.t_namespaceFound)

Searching for testVersion in previous issues I found this issue https://github.com/Automattic/_s/pull/1393.

I have tried adding the specified testVersion number back in as a command argument in the composer.json file and running the command does not return any errors.

$ composer lint:wpc
> @php ./vendor/squizlabs/php_codesniffer/bin/phpcs --runtime-set testVersion 5.6-
....... 7 / 7 (100%)

Any ideas why setting the version number with testVersion in phpcs.xml.dist is not working?