Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.0 | Keywords/NewKeywords: detect the new match keyword (RFC) #1597

Merged
merged 1 commit into from
Aug 4, 2023

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 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
43 checks passed
@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
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.

None yet

2 participants