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

Tokenizer/PHP: bug fix in improved context sensitive keyword support #3610

Conversation

jrfnl
Copy link
Contributor

@jrfnl jrfnl commented Jun 13, 2022

As reported in #3609, the empty keyword, as well as the isset and unset keywords, was not included in the list of context sensitive keyword. This is a regression compared to PHPCS 3.6.2.

Fixed now, including unit tests.

Note: I've now done a full comparison with the reserved keyword list as per the PHP manual. This should hopefully fix the remaining stragglers.

Fixes #3609

As reported in 3609, the `empty` keyword, as well as the `isset` and `unset` keywords, was not included in the list of context sensitive keyword. This is a regression compared to PHPCS 3.6.2.

Fixed now, including unit tests.

Note: I've now done a full comparison with the [reserved keyword list as per the PHP manual](https://www.php.net/manual/en/reserved.keywords.php). This should hopefully fix the remaining stranglers.

Fixes 3609
@gsherwood gsherwood added this to the 3.7.1 milestone Jun 13, 2022
gsherwood added a commit that referenced this pull request Jun 13, 2022
@gsherwood gsherwood merged commit 3726154 into squizlabs:master Jun 13, 2022
@gsherwood
Copy link
Member

Fixed in 30mins 😱

Thank you!

@jrfnl jrfnl deleted the feature/3609-bugfix-context-sensitive-keyword-empty branch June 13, 2022 10:52
@jrfnl
Copy link
Contributor Author

jrfnl commented Jun 13, 2022

And merged 45 minutes later, we're on a roll 🛼

@kukulich
Copy link
Contributor

@jrfnl Thank you. I used the list from https://wiki.php.net/rfc/context_sensitive_lexer and it looks it was not complete...

@jrfnl
Copy link
Contributor Author

jrfnl commented Jun 20, 2022

@kukulich No worries and yeah, that happens regularly with PHP RFCs (not being complete). I regularly run into that when working on PHPCompatibility.

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.

Methods/constants with name empty/isset/unset are always reported as error
3 participants