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

[Php73] Skip double escape dash on next with quantifier outside bracket on RegexDashEscapeRector #1006

Merged
merged 6 commits into from
Oct 15, 2021

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Oct 15, 2021

Given the following code:

class SkipDoubleEscapeMoreQuantifiers
{
    public function run(string $string)
    {
        preg_match('#^\-\s*[0-9]+$#', $string);
    }
}

It currently produce:

-        preg_match('#^\-\s*[0-9]+$#', $string);
+        preg_match('#^\\-\s*[0-9]+$#', $string);

which can be skipped.

@samsonasik samsonasik changed the title [Php73] Skip escape dash outside bracket on RegexDashEscapeRector [Php73] Skip double escape dash outside bracket on RegexDashEscapeRector Oct 15, 2021
@samsonasik
Copy link
Member Author

Fixed 🎉

@samsonasik samsonasik changed the title [Php73] Skip double escape dash outside bracket on RegexDashEscapeRector [Php73] Skip double escape dash on next with quantifier outside bracket on RegexDashEscapeRector Oct 15, 2021
@samsonasik
Copy link
Member Author

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

@TomasVotruba TomasVotruba merged commit 2d6a25b into main Oct 15, 2021
@TomasVotruba TomasVotruba deleted the skip-escape-dash branch October 15, 2021 16:24
@TomasVotruba
Copy link
Member

Thank you 👍

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