Skip to content

PHP CS Fixer linter version available is not correct since running on PHP 8.4 runtime #4610

@llaville

Description

@llaville

Describe the bug
Since MegaLinter run with PHP 8.4 runtime, the PHP CS Fixer linter does not display correctly it own version

Expected behavior

See the last versions available instead of 7.4.0

When I write this report it's 3.68.3

Screenshots

As suggested by @nvuillam, here are the fix tests with regular expression.

Image

Additional context

When running on PHP 8.4, PHP CS Fixer 3.68 always write, on standard output, the warning message PHP needs to be a minimum version of PHP 7.4.0 and maximum version of PHP 8.3.*.

When PHP_CS_FIXER_IGNORE_ENV is not set

PHP_CS_FIXER_IGNORE_ENV=0 php ./php-cs-fixer-3.68.phar --version

PHP needs to be a minimum version of PHP 7.4.0 and maximum version of PHP 8.3.*.
Current PHP version: 8.4.3.
To ignore this requirement please set `PHP_CS_FIXER_IGNORE_ENV`.
If you use PHP version higher than supported, you may experience code modified in a wrong way.
Please report such cases at https://github.com/PHP-CS-Fixer/PHP-CS-Fixer .

When PHP_CS_FIXER_IGNORE_ENV is set

PHP_CS_FIXER_IGNORE_ENV=1 php ./php-cs-fixer-3.68.phar --version

PHP needs to be a minimum version of PHP 7.4.0 and maximum version of PHP 8.3.*.
Current PHP version: 8.4.3.
Ignoring environment requirements because `PHP_CS_FIXER_IGNORE_ENV` is set. Execution may be unstable.
PHP CS Fixer 3.68.3 (2ec2180) Persian Successor by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.4.3

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions