@@ -137,11 +137,8 @@ private static function renderEscapeSequences(string $body): string
137
137
*/
138
138
private static function renderHexadecimalSequences (string $ body ): string
139
139
{
140
- $ callee = static fn (array $ matches ): string
141
- => \chr ((int ) \hexdec ((string ) $ matches [1 ]))
142
- ;
143
-
144
- return @\preg_replace_callback (self ::HEX_SEQUENCE_PATTERN , $ callee , $ body ) ?? $ body ;
140
+ return @\preg_replace_callback (self ::HEX_SEQUENCE_PATTERN , static fn (array $ matches ): string
141
+ => \chr ((int ) \hexdec ($ matches [1 ])), $ body ) ?? $ body ;
145
142
}
146
143
147
144
/**
@@ -152,8 +149,8 @@ private static function renderHexadecimalSequences(string $body): string
152
149
*/
153
150
private static function renderUtfSequences (string $ body ): string
154
151
{
155
- $ callee = static function (array $ matches ): string {
156
- $ code = (int ) \hexdec (( string ) $ matches [1 ]);
152
+ return @ \preg_replace_callback ( self :: UTF_SEQUENCE_PATTERN , static function (array $ matches ): string {
153
+ $ code = (int ) \hexdec ($ matches [1 ]);
157
154
158
155
// @phpstan-ignore-next-line : PHPStan false-positive mb_chr evaluation
159
156
if (\function_exists ('\\mb_chr ' ) && ($ result = \mb_chr ($ code )) !== false ) {
@@ -179,9 +176,7 @@ private static function renderUtfSequences(string $body): string
179
176
. \chr (0x80 | $ code >> 12 & 0x3F )
180
177
. \chr (0x80 | $ code >> 6 & 0x3F )
181
178
. \chr (0x80 | $ code & 0x3F );
182
- };
183
-
184
- return @\preg_replace_callback (self ::UTF_SEQUENCE_PATTERN , $ callee , $ body ) ?? $ body ;
179
+ }, $ body ) ?? $ body ;
185
180
}
186
181
187
182
public function getValue (): string
0 commit comments