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: prevent an "Undefined array key" notice during live coding #782

Merged

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Jan 10, 2025

Description

During live coding or for code containing a parse error, it was possible for the tokenizer to run into an Undefined array key "parenthesis_closer" error when trying to verify arrow functions.

As this error happens during the tokenization, this resulted in PHPCS silently not scanning the file - without even showing the error notice.

Fixed now.

Includes tests.

Suggested changelog entry

Tokenizer/PHP: prevent a potential error notice during live coding for unfinished arrow functions

…ding

During live coding or for code containing a parse error, it was possible for the tokenizer to run into an `Undefined array key "parenthesis_closer"` error when trying to verify arrow functions.

As this error happens during the tokenization, this resulted in PHPCS silently not scanning the file - without even showing the error notice.

Fixed now.

Includes tests.
@jrfnl jrfnl merged commit ba08a82 into master Jan 11, 2025
72 checks passed
@jrfnl jrfnl deleted the feature/tokenizer-php-prevent-undefined-array-key-notice branch January 11, 2025 03:00
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.

2 participants