Skip to content

Conversation

@jrfnl
Copy link
Member

@jrfnl jrfnl commented Aug 4, 2023

PHP 8.0 introduced match expressions.

What with originally still supporting a wide range of PHPCS versions, detection of match expressions would need a lot of custom logic, so this would get a separate sniff (which I had as WIP locally).

However, now support for PHPCS < 3.7.1 has been dropped, detection of the keyword can be handled by the NewKeywords sniff. Includes the tests I had originally set up for the separate sniff.

Refs:

Related to #809

PHP 8.0 introduced match expressions.

What with originally still supporting a wide range of PHPCS versions, detection of match expressions would need a lot of custom logic, so this would get a separate sniff (which I had as WIP locally).

However, now support for PHPCS < 3.7.1 has been dropped, detection of the keyword can be handled by the `NewKeywords` sniff.
Includes the tests I had originally set up for the separate sniff.

Refs:
* https://wiki.php.net/rfc/match_expression_v2
* php/php-src#5371
* php/php-src@9fa1d13

Related to 809
@jrfnl jrfnl added Type: enhancement PR: quick merge PR only contains relatively simple changes PR: ready for review labels Aug 4, 2023
@jrfnl jrfnl added this to the 10.0.0 milestone Aug 4, 2023
@jrfnl jrfnl requested a review from wimg August 4, 2023 20:00
@wimg wimg merged commit b483138 into develop Aug 4, 2023
@wimg wimg deleted the php-8.0/newkeywords-detect-match branch August 4, 2023 21:49
@github-actions github-actions bot removed PR: quick merge PR only contains relatively simple changes PR: ready for review labels Aug 4, 2023
@jrfnl jrfnl added the PHP: 8.0 label Nov 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants