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

[Comments] Handle new line mix betweeen \n and \r\n in the code on CommentedCodeAnalyzer #23

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

samsonasik
Copy link
Member

when code is generated code or being read by some tool may cause multiple different line endings, so can't rely on PHP_EOL, use \r?\n regex instead,

see https://3v4l.org/Y8pSD

The behaviour is same with Rector's NewLineSplitter https://github.com/rectorphp/rector-src/blob/a16a04d0bc90df11918efd4b7fc117a9e3dcc1c3/src/Util/NewLineSplitter.php#L15-L23

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I think it is ready.

@TomasVotruba TomasVotruba merged commit b2b162e into rectorphp:main Apr 4, 2024
7 checks passed
@TomasVotruba
Copy link
Member

Thanks 👍

@samsonasik samsonasik deleted the handle-new-line-mix branch April 4, 2024 19:21
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.

2 participants