Skip to content

Commit 7e812c8

Browse files
authored
[CLEANUP] Avoid Hungarian notation for start(Position) (#977)
Part of #756
1 parent 6f1fc2c commit 7e812c8

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/Parsing/ParserState.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -424,21 +424,21 @@ public function strlen($string): int
424424
}
425425

426426
/**
427-
* @param int $iStart
427+
* @param int $offset
428428
* @param int $length
429429
*/
430-
private function substr($iStart, $length): string
430+
private function substr($offset, $length): string
431431
{
432432
if ($length < 0) {
433-
$length = \count($this->characters) - $iStart + $length;
433+
$length = \count($this->characters) - $offset + $length;
434434
}
435-
if ($iStart + $length > \count($this->characters)) {
436-
$length = \count($this->characters) - $iStart;
435+
if ($offset + $length > \count($this->characters)) {
436+
$length = \count($this->characters) - $offset;
437437
}
438438
$result = '';
439439
while ($length > 0) {
440-
$result .= $this->characters[$iStart];
441-
$iStart++;
440+
$result .= $this->characters[$offset];
441+
$offset++;
442442
$length--;
443443
}
444444
return $result;

src/Value/Value.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,23 @@ public static function parseValue(ParserState $parserState, array $aListDelimite
7878
return $aStack[0];
7979
}
8080
$aNewStack = [];
81-
for ($iStartPosition = 0; $iStartPosition < $iStackLength; ++$iStartPosition) {
82-
if ($iStartPosition === ($iStackLength - 1) || $sDelimiter !== $aStack[$iStartPosition + 1]) {
83-
$aNewStack[] = $aStack[$iStartPosition];
81+
for ($offset = 0; $offset < $iStackLength; ++$offset) {
82+
if ($offset === ($iStackLength - 1) || $sDelimiter !== $aStack[$offset + 1]) {
83+
$aNewStack[] = $aStack[$offset];
8484
continue;
8585
}
8686
$length = 2; //Number of elements to be joined
87-
for ($i = $iStartPosition + 3; $i < $iStackLength; $i += 2, ++$length) {
87+
for ($i = $offset + 3; $i < $iStackLength; $i += 2, ++$length) {
8888
if ($sDelimiter !== $aStack[$i]) {
8989
break;
9090
}
9191
}
9292
$list = new RuleValueList($sDelimiter, $parserState->currentLine());
93-
for ($i = $iStartPosition; $i - $iStartPosition < $length * 2; $i += 2) {
93+
for ($i = $offset; $i - $offset < $length * 2; $i += 2) {
9494
$list->addListComponent($aStack[$i]);
9595
}
9696
$aNewStack[] = $list;
97-
$iStartPosition += $length * 2 - 2;
97+
$offset += $length * 2 - 2;
9898
}
9999
$aStack = $aNewStack;
100100
}

0 commit comments

Comments
 (0)