Skip to content

Conversation

@jrfnl
Copy link
Member

@jrfnl jrfnl commented Jul 31, 2024

Description

The PHP tokenizer contains logic to:

  • Retokenize the start/end tokens for nowdocs from T_(START|END)_HEREDOC to T_(START|END)_NOWDOC;
  • Retokenize the contents of a heredoc/nowdoc to T_HEREDOC/T_NOWDOC tokens.
  • Retokenize the start token from T_START_(HERE|NOW)DOC to T_STRING if the heredoc/nowdoc is unclosed;
  • Ensure that each line in the contents has its own token.

This commit adds tests safeguarding and documenting this part of the tokenizer.

Suggested changelog entry

N/A

The PHP tokenizer contains logic to:
* Retokenize the start/end tokens for nowdocs from `T_(START|END)_HEREDOC` to `T_(START|END)_NOWDOC`;
* Retokenize the _contents_ of a heredoc/nowdoc to `T_HEREDOC`/`T_NOWDOC` tokens.
* Retokenize the start token from `T_START_(HERE|NOW)DOC` to `T_STRING` if the heredoc/nowdoc is unclosed;
* Ensure that each line in the contents has its own token.

This commit adds tests safeguarding and documenting this part of the tokenizer.
@jrfnl jrfnl added this to the 3.10.x Next milestone Jul 31, 2024
@jrfnl jrfnl merged commit e5c46d3 into master Jul 31, 2024
@jrfnl jrfnl deleted the feature/tokenizer-php-add-tests-heredoc-nowdoc branch July 31, 2024 04:13
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