Skip to content

chore: replace microsoft/tolerant-php-parser with native PhpToken - #883

Merged
bshaffer merged 6 commits into
mainfrom
remove-tolerant-php-parser
Oct 9, 2026
Merged

bshaffer merged 6 commits into
mainfrom
remove-tolerant-php-parser

Conversation

@bshaffer

@bshaffer bshaffer commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Replaces the unmaintained microsoft/tolerant-php-parser dependency in FragmentInjectionProcessor with PHP's built-in PhpToken::tokenize().

@bshaffer
bshaffer requested a review from a team as a code owner October 5, 2026 20:09

@torreypayne torreypayne left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My questions are more high-level:

1. Looking at the microsoft/tolerant-php-parser library itself, are we sure it's unmaintained? Looking at the recent releases, it seems to be actively maintained.

2. Are we sure we want to migrate from a library to a bespoke implementation that we have to maintain long-term? This part of the generator is doing heavy lifting so this is more of a directional question.

Looking deeper into how the processor is actually used, the relative scope is very small so we don't need to really overdo the migration. Also, I see that indeed the library is unmaintained so LGTM.

T_FINAL,
T_ABSTRACT,
T_DOC_COMMENT,
T_COMMENT,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we missing any types here? Just double-checking

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — added PHP 8 attribute support here and a test case for it.

@robertvoinescu-work robertvoinescu-work left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bshaffer
bshaffer merged commit f3396d2 into main Oct 9, 2026
15 checks passed
@bshaffer
bshaffer deleted the remove-tolerant-php-parser branch October 9, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants