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

[CodingStyle] Skip new line /\r\n|\r|\n/i on ConsistentPregDelimiterRector #3241

Merged
merged 2 commits into from Dec 22, 2022

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Dec 22, 2022

Given the following code:

    public function run2()
    {
        $content = 'some texte';
        $parts = preg_split("/\r\n|\r|\n/i", $content);
    }

It currently produce:

     public function run2()
     {
         $content = 'some texte';
-        $parts = preg_split("/\r\n|\r|\n/i", $content);
+        $parts = preg_split("#
||
+#i", $content);

Ref https://getrector.org/demo/94c2d1af-be82-478a-ae1b-a44783a1f741

It should be skipped instead.

@samsonasik
Copy link
Member Author

Fixed 🎉

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba it is ready for review.

@TomasVotruba TomasVotruba merged commit 3c168f0 into main Dec 22, 2022
@TomasVotruba TomasVotruba deleted the skip-new-line-i branch December 22, 2022 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants