Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is essentially revival of #4643 and #4689.
On current 2.1.x branch,
make csfails with below error only on PHP 8.5.This is because
SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnlysniff usesfunction_existsto decide if it checks the function calls.On PHP 8.4 or lower,
array_last()does not exist so the sniff doesn't check the usage of the function.https://github.com/slevomat/coding-standard/blob/90b688162eba700bebca1f045ef5fe6f1936bc15/SlevomatCodingStandard/Sniffs/Namespaces/ReferenceUsedNamesOnlySniff.php#L207-L209
In this PR those errors are fixed with
make cs-fix, and PHP_CodeSniffer are now run on CI with PHP 8.5.With this fix, PHP-Scoper mistakenly prefixes
array_lastbecause it doesn't know the latest functions of PHP.(Reported as humbug/php-scoper#1142)
As a workaround,
jetbrains/phpstorm-stubswas added tocompiler/box/composer.jsonso we can usedev-masterversion. The package is used by PHP-Scoper as the list of internal functions.