RCAT-759: Setting PHP version shouldn't be done in base rulesets
Describe the bug Since #76 phpcompatibility now loads top-down versions of php using the last one as it's ruleset. Since this change and the set version in the main ruleset (see #37 ) it is now impossible to set a php version outside of that if using the ruleset.
To Reproduce
Set your testVersion to anything other than 7.4- in your phpcs.xml (I was using 8.3), and then run a phpcs with a rule like would break in 7.4 or below, you will see it break, i.e.
--------------------------------------------------------------------------------
37 | ERROR | Trailing commas are not allowed in function declaration parameter
| | lists in PHP 7.4 or earlier
| | (PHPCompatibility.FunctionDeclarations.NewTrailingComma.InParameterList)
--------------------------------------------------------------------------------
Expected behavior
PHPCompatibility should use the set php version in phpcs.xml
Proposed Fix
Remove the set testversion in src/Standards/AcquiaDrupalMinimal/ruleset.xml and instead set this in example/phpcs.xml.dist so that the user is in control of the testVersion
I was facing the same issue, and the patch fixed it. Thanks!
This patch fixed it for me. Thx!