Skip to content

Commit 0a7db77

Browse files
Merge branch '4.4' into 5.1
* 4.4: Changed private static array-properties to const
2 parents 5d62c4f + a170990 commit 0a7db77

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Escaper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ class Escaper
2828
// first to ensure proper escaping because str_replace operates iteratively
2929
// on the input arrays. This ordering of the characters avoids the use of strtr,
3030
// which performs more slowly.
31-
private static $escapees = ['\\', '\\\\', '\\"', '"',
31+
private const ESCAPEES = ['\\', '\\\\', '\\"', '"',
3232
"\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07",
3333
"\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f",
3434
"\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17",
3535
"\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f",
3636
"\x7f",
3737
"\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9",
3838
];
39-
private static $escaped = ['\\\\', '\\"', '\\\\', '\\"',
39+
private const ESCAPED = ['\\\\', '\\"', '\\\\', '\\"',
4040
'\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a',
4141
'\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f',
4242
'\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17',
@@ -66,7 +66,7 @@ public static function requiresDoubleQuoting(string $value): bool
6666
*/
6767
public static function escapeWithDoubleQuotes(string $value): string
6868
{
69-
return sprintf('"%s"', str_replace(self::$escapees, self::$escaped, $value));
69+
return sprintf('"%s"', str_replace(self::ESCAPEES, self::ESCAPED, $value));
7070
}
7171

7272
/**

0 commit comments

Comments
 (0)