@@ -28,15 +28,15 @@ class Escaper
28
28
// first to ensure proper escaping because str_replace operates iteratively
29
29
// on the input arrays. This ordering of the characters avoids the use of strtr,
30
30
// which performs more slowly.
31
- private static $ escapees = ['\\' , '\\\\' , '\\" ' , '" ' ,
31
+ private const ESCAPEES = ['\\' , '\\\\' , '\\" ' , '" ' ,
32
32
"\x00" , "\x01" , "\x02" , "\x03" , "\x04" , "\x05" , "\x06" , "\x07" ,
33
33
"\x08" , "\x09" , "\x0a" , "\x0b" , "\x0c" , "\x0d" , "\x0e" , "\x0f" ,
34
34
"\x10" , "\x11" , "\x12" , "\x13" , "\x14" , "\x15" , "\x16" , "\x17" ,
35
35
"\x18" , "\x19" , "\x1a" , "\x1b" , "\x1c" , "\x1d" , "\x1e" , "\x1f" ,
36
36
"\x7f" ,
37
37
"\xc2\x85" , "\xc2\xa0" , "\xe2\x80\xa8" , "\xe2\x80\xa9" ,
38
38
];
39
- private static $ escaped = ['\\\\' , '\\" ' , '\\\\' , '\\" ' ,
39
+ private const ESCAPED = ['\\\\' , '\\" ' , '\\\\' , '\\" ' ,
40
40
'\\0 ' , '\\x01 ' , '\\x02 ' , '\\x03 ' , '\\x04 ' , '\\x05 ' , '\\x06 ' , '\\a ' ,
41
41
'\\b ' , '\\t ' , '\\n ' , '\\v ' , '\\f ' , '\\r ' , '\\x0e ' , '\\x0f ' ,
42
42
'\\x10 ' , '\\x11 ' , '\\x12 ' , '\\x13 ' , '\\x14 ' , '\\x15 ' , '\\x16 ' , '\\x17 ' ,
@@ -66,7 +66,7 @@ public static function requiresDoubleQuoting(string $value): bool
66
66
*/
67
67
public static function escapeWithDoubleQuotes (string $ value ): string
68
68
{
69
- return sprintf ('"%s" ' , str_replace (self ::$ escapees , self ::$ escaped , $ value ));
69
+ return sprintf ('"%s" ' , str_replace (self ::ESCAPEES , self ::ESCAPED , $ value ));
70
70
}
71
71
72
72
/**
0 commit comments