-
-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Php73] Skip double escape dash on next with quantifier outside brack…
…et on RegexDashEscapeRector (#1006) * [Php73] Skip escape dash outside bracket on RegexDashEscapeRector * rename fixture * rename * fix more quantifiers * final touch * add more fixture
- Loading branch information
1 parent
4e377b2
commit 2d6a25b
Showing
3 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
...Rector/FuncCall/RegexDashEscapeRector/Fixture/skip_double_escape_more_quantifiers.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php73\Rector\FuncCall\RegexDashEscapeRector\Fixture; | ||
|
||
class SkipDoubleEscapeMoreQuantifiers | ||
{ | ||
public function run(string $string) | ||
{ | ||
preg_match('#^\-\s*[0-9]+$#', $string); | ||
preg_match('#^\-\s+[0-9]+$#', $string); | ||
preg_match('#^\-\s{1,10}[0-9]+$#', $string); | ||
preg_match('#^\-\s{1,}[0-9]+$#', $string); | ||
preg_match('#^\-\s(ab)*[0-9]+$#', $string); | ||
preg_match('#^\-\s(ab){1,10}[0-9]+$#', $string); | ||
} | ||
} | ||
|
||
?> |
13 changes: 13 additions & 0 deletions
13
...tor/FuncCall/RegexDashEscapeRector/Fixture/skip_double_escape_next_non_quantifier.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\Php73\Rector\FuncCall\RegexDashEscapeRector\Fixture; | ||
|
||
class SkipDoubleEscapeNextNonQuantifier | ||
{ | ||
public function run(string $string) | ||
{ | ||
preg_match('#^\-\sa[0-9]+$#', $string); | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters