Composer: raise the minimum supported PHPCS + PHPCSUtils versions + fix test failures #1806
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.
Since the release of PHPCS 3.12.2, one test is failing on older PHP versions.
Since the release of PHPCSUtils 1.1.0, another two tests are failing.
This PR is intended to unblock contributors by fixing these CI failures.
Other updates which can/should be made for the more recent PHPCS versions and related to PHPCSUtils 1.1.0 will follow in separate PRs.
Composer: raise the minimum supported PHPCSUtils version to 1.1.0
... to benefit from new functionality related to PHP 8.3, 8.4 and PHPCS 4.0.
As the minimum supported PHPCS version for PHPCSUtils 1.1.0 is PHPCS 3.13.0, the minimum PHPCS version has also been raised.
Refs:
Miscellaneous/NewPHPOpenTagEOF: remove work-arounds which are no longer needed
PHPCS 3.12.2 fixed a PHP tokenization inconsistency directly related to what this sniff is detecting.
As the PHPCS tokenization will now be the same PHP cross-version, we can remove the work-arounds which were in place to accommodate the previous difference in tokenization.
Ref:
FunctionDeclarations/ForbiddenVariableNamesInClosureUse: catch potential exception
The following PHPCSUtils 1.1.0 change was causing the tests to fail:
This change means that during live coding, in specific cases where a closure declaration is incomplete, the
UseStatements::getType()method will still correctly detect theuseas a closureuse.However, the
FunctionDeclarations::getParameters()method will not handle such incomplete code and will throw an exception as the parameters imported via the closureusecannot be reliably retrieved.Fixed now by catching this potential exception.
PHP 8.4 | NewNamedParameters: handle named params passed to exit/die
This commit adds detection of the use of named arguments passed to
exit()/die()to theNewNamedParameterssniff.Includes tests.
Note: sniff updates for the other aspects of this PHP 8.4 feature will be pulled separately.
Refs:
Related to #1731