Skip to content

Workaround fix for missing newline in attributes in ReadOnlyClassRector#3839

Merged
TomasVotruba merged 2 commits intomainfrom
tv-readonly-nextline
May 14, 2023
Merged

Workaround fix for missing newline in attributes in ReadOnlyClassRector#3839
TomasVotruba merged 2 commits intomainfrom
tv-readonly-nextline

Conversation

@TomasVotruba
Copy link
Copy Markdown
Member

@TomasVotruba TomasVotruba commented May 14, 2023

@TomasVotruba TomasVotruba changed the title tv readonly nextline Workaround fix for missing newline in attributes in ReadOnlyClassRector May 14, 2023
@TomasVotruba TomasVotruba force-pushed the tv-readonly-nextline branch from 91e7440 to 7462acd Compare May 14, 2023 13:34
@TomasVotruba TomasVotruba enabled auto-merge (squash) May 14, 2023 13:35
@TomasVotruba
Copy link
Copy Markdown
Member Author

Just looking into it. This is a bug in php-parser in formatPreservingPrinter. The input here is valid and class node itself is printed correctly, if the orig node is made null.

I've added a workaround to reprint the whole Class_ from scratch, but php-parser fix is needed.

@TomasVotruba TomasVotruba disabled auto-merge May 14, 2023 13:37
@TomasVotruba
Copy link
Copy Markdown
Member Author

TomasVotruba commented May 14, 2023

Possibly related is this PR in php-parser:

@TomasVotruba TomasVotruba merged commit f3b6bfa into main May 14, 2023
@TomasVotruba TomasVotruba deleted the tv-readonly-nextline branch May 14, 2023 13:49
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.

Incorrect behavior of ReadOnlyClassRector

1 participant