Skip to content

Commit eb87ed6

Browse files
committed
Fixed Pattern::escape() not returning a string
1 parent 7724611 commit eb87ed6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Pattern.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ public static function directorySeparator(string $separator): void
5050
}
5151

5252
/** Escape glob pattern characters from a string. */
53-
public static function escape(string $string): self
53+
public static function escape(string $string): string
5454
{
55-
return new self(str_replace([
55+
return str_replace([
5656
'\\', '?', '*', '(', ')', '[', ']', '^', '{', '}', ',',
5757
], [
5858
'\\\\', '\\?', '\\*', '\\(', '\\)', '\\[', '\\]', '\\^', '\\{', '\\}', '\\,',
59-
], $string));
59+
], $string);
6060
}
6161

6262
/** Convert the pattern a regular expression. */

0 commit comments

Comments
 (0)