From 879e54614fd77ca58bfdc4f7a82974293eca43c7 Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Thu, 20 Feb 2025 11:21:02 +0100 Subject: [PATCH] [CLEANUP] Avoid Hungarian notation in `parseCharacter()` Part of #756 --- src/Parsing/ParserState.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Parsing/ParserState.php b/src/Parsing/ParserState.php index c64f9262..1dd93b25 100644 --- a/src/Parsing/ParserState.php +++ b/src/Parsing/ParserState.php @@ -170,8 +170,8 @@ public function parseCharacter($isForIdentifier) if (\preg_match('/[0-9a-fA-F]/Su', $this->peek()) === 0) { return $this->consume(1); } - $sUnicode = $this->consumeExpression('/^[0-9a-fA-F]{1,6}/u', 6); - if ($this->strlen($sUnicode) < 6) { + $hexCodePoint = $this->consumeExpression('/^[0-9a-fA-F]{1,6}/u', 6); + if ($this->strlen($hexCodePoint) < 6) { // Consume whitespace after incomplete unicode escape if (\preg_match('/\\s/isSu', $this->peek())) { if ($this->comes('\\r\\n')) { @@ -181,13 +181,13 @@ public function parseCharacter($isForIdentifier) } } } - $iUnicode = \intval($sUnicode, 16); - $sUtf32 = ''; + $codePoint = \intval($hexCodePoint, 16); + $utf32EncodedCharacter = ''; for ($i = 0; $i < 4; ++$i) { - $sUtf32 .= \chr($iUnicode & 0xff); - $iUnicode = $iUnicode >> 8; + $utf32EncodedCharacter .= \chr($codePoint & 0xff); + $codePoint = $codePoint >> 8; } - return \iconv('utf-32le', $this->charset, $sUtf32); + return \iconv('utf-32le', $this->charset, $utf32EncodedCharacter); } if ($isForIdentifier) { $peek = \ord($this->peek());