Skip to content

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