Skip to content

Commit b283aab

Browse files
committed
[CLEANUP] Avoid Hungarian notation for *stack*
Part of #756
1 parent f54a5b6 commit b283aab

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/Value/Value.php

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -43,69 +43,69 @@ public function __construct($lineNumber = 0)
4343
*/
4444
public static function parseValue(ParserState $parserState, array $aListDelimiters = [])
4545
{
46-
/** @var array<int, Value|string> $aStack */
47-
$aStack = [];
46+
/** @var array<int, Value|string> $stack */
47+
$stack = [];
4848
$parserState->consumeWhiteSpace();
4949
//Build a list of delimiters and parsed values
5050
while (
5151
!($parserState->comes('}') || $parserState->comes(';') || $parserState->comes('!')
5252
|| $parserState->comes(')')
5353
|| $parserState->isEnd())
5454
) {
55-
if (\count($aStack) > 0) {
55+
if (\count($stack) > 0) {
5656
$bFoundDelimiter = false;
5757
foreach ($aListDelimiters as $sDelimiter) {
5858
if ($parserState->comes($sDelimiter)) {
59-
\array_push($aStack, $parserState->consume($sDelimiter));
59+
\array_push($stack, $parserState->consume($sDelimiter));
6060
$parserState->consumeWhiteSpace();
6161
$bFoundDelimiter = true;
6262
break;
6363
}
6464
}
6565
if (!$bFoundDelimiter) {
6666
//Whitespace was the list delimiter
67-
\array_push($aStack, ' ');
67+
\array_push($stack, ' ');
6868
}
6969
}
70-
\array_push($aStack, self::parsePrimitiveValue($parserState));
70+
\array_push($stack, self::parsePrimitiveValue($parserState));
7171
$parserState->consumeWhiteSpace();
7272
}
7373
// Convert the list to list objects
7474
foreach ($aListDelimiters as $sDelimiter) {
75-
$iStackLength = \count($aStack);
76-
if ($iStackLength === 1) {
77-
return $aStack[0];
75+
$stackSize = \count($stack);
76+
if ($stackSize === 1) {
77+
return $stack[0];
7878
}
79-
$aNewStack = [];
80-
for ($offset = 0; $offset < $iStackLength; ++$offset) {
81-
if ($offset === ($iStackLength - 1) || $sDelimiter !== $aStack[$offset + 1]) {
82-
$aNewStack[] = $aStack[$offset];
79+
$newStack = [];
80+
for ($offset = 0; $offset < $stackSize; ++$offset) {
81+
if ($offset === ($stackSize - 1) || $sDelimiter !== $stack[$offset + 1]) {
82+
$newStack[] = $stack[$offset];
8383
continue;
8484
}
8585
$length = 2; //Number of elements to be joined
86-
for ($i = $offset + 3; $i < $iStackLength; $i += 2, ++$length) {
87-
if ($sDelimiter !== $aStack[$i]) {
86+
for ($i = $offset + 3; $i < $stackSize; $i += 2, ++$length) {
87+
if ($sDelimiter !== $stack[$i]) {
8888
break;
8989
}
9090
}
9191
$list = new RuleValueList($sDelimiter, $parserState->currentLine());
9292
for ($i = $offset; $i - $offset < $length * 2; $i += 2) {
93-
$list->addListComponent($aStack[$i]);
93+
$list->addListComponent($stack[$i]);
9494
}
95-
$aNewStack[] = $list;
95+
$newStack[] = $list;
9696
$offset += $length * 2 - 2;
9797
}
98-
$aStack = $aNewStack;
98+
$stack = $newStack;
9999
}
100-
if (!isset($aStack[0])) {
100+
if (!isset($stack[0])) {
101101
throw new UnexpectedTokenException(
102102
" {$parserState->peek()} ",
103103
$parserState->peek(1, -1) . $parserState->peek(2),
104104
'literal',
105105
$parserState->currentLine()
106106
);
107107
}
108-
return $aStack[0];
108+
return $stack[0];
109109
}
110110

111111
/**

0 commit comments

Comments
 (0)