Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Commit f3d6bbe

Browse files
authored
Add backslash method and remove "all" modifier (#42)
1 parent fe6c205 commit f3d6bbe

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/Builder.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use SRL\Interfaces\TestMethodProvider;
1818

1919
/**
20-
* @method $this all() Apply the 'g' modifier
2120
* @method $this multiLine() Apply the 'm' modifier
2221
* @method $this singleLine() Apply the 's' modifier
2322
* @method $this caseInsensitive() Apply the 'i' modifier
@@ -34,6 +33,7 @@
3433
* @method $this noWhitespace() Match any non-whitespace character.
3534
* @method $this anyCharacter() Match any word character.
3635
* @method $this noCharacter() Match any non-word character.
36+
* @method $this backslash() Match a backslash (\).
3737
*/
3838
class Builder extends TestMethodProvider
3939
{
@@ -57,7 +57,6 @@ class Builder extends TestMethodProvider
5757

5858
/** @var string[] Map method names to actual modifiers. */
5959
protected $modifierMapper = [
60-
'all' => 'g',
6160
'multiLine' => 'm',
6261
'singleLine' => 's',
6362
'caseInsensitive' => 'i',
@@ -121,7 +120,12 @@ class Builder extends TestMethodProvider
121120
'add' => '\W',
122121
'type' => self::METHOD_TYPE_CHARACTER,
123122
'allowed' => self::METHOD_TYPES_ALLOWED_FOR_CHARACTERS
124-
]
123+
],
124+
'backslash' => [
125+
'add' => '\\',
126+
'type' => self::METHOD_TYPE_CHARACTER,
127+
'allowed' => self::METHOD_TYPES_ALLOWED_FOR_CHARACTERS
128+
],
125129
];
126130

127131
/** @var string Desired group, if any. */

src/SRL.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
* @method static \SRL\Builder digit(int $min = 0, int $max = 9)
1818
* @method static \SRL\Builder uppercaseLetter(string $min = 'A', string $max = 'Z')
1919
* @method static \SRL\Builder letter(string $min = 'a', string $max = 'z')
20-
* @method static \SRL\Builder all() Apply the 'g' modifier
2120
* @method static \SRL\Builder multiLine() Apply the 'm' modifier
2221
* @method static \SRL\Builder singleLine() Apply the 's' modifier
2322
* @method static \SRL\Builder caseInsensitive() Apply the 'i' modifier
@@ -33,6 +32,7 @@
3332
* @method static \SRL\Builder noWhitespace() Match any non-whitespace character.
3433
* @method static \SRL\Builder anyCharacter() Match any word character.
3534
* @method static \SRL\Builder noCharacter() Match any non-word character.
35+
* @method static \SRL\Builder backslash() Match a backslash (\).
3636
*
3737
* @mixin \SRL\Language\Interpreter
3838
*/

0 commit comments

Comments
 (0)