rectorphp / swiss-knife

Swiss knife in pocket of every upgrade architect!
https://getrector.com
MIT License
72 stars 8 forks source link

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

Closed samsonasik closed 3 months ago

samsonasik commented 3 months ago

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 commented 3 months ago

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

TomasVotruba commented 3 months ago

Thanks :+1: