@@ -137,11 +137,8 @@ private static function renderEscapeSequences(string $body): string
137137 */
138138 private static function renderHexadecimalSequences (string $ body ): string
139139 {
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 ;
145142 }
146143
147144 /**
@@ -152,8 +149,8 @@ private static function renderHexadecimalSequences(string $body): string
152149 */
153150 private static function renderUtfSequences (string $ body ): string
154151 {
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 ]);
157154
158155 // @phpstan-ignore-next-line : PHPStan false-positive mb_chr evaluation
159156 if (\function_exists ('\\mb_chr ' ) && ($ result = \mb_chr ($ code )) !== false ) {
@@ -179,9 +176,7 @@ private static function renderUtfSequences(string $body): string
179176 . \chr (0x80 | $ code >> 12 & 0x3F )
180177 . \chr (0x80 | $ code >> 6 & 0x3F )
181178 . \chr (0x80 | $ code & 0x3F );
182- };
183-
184- return @\preg_replace_callback (self ::UTF_SEQUENCE_PATTERN , $ callee , $ body ) ?? $ body ;
179+ }, $ body ) ?? $ body ;
185180 }
186181
187182 public function getValue (): string
0 commit comments