Skip to content

Commit 116ab69

Browse files
authored
[CLEANUP] Avoid Hungarian notation for oList and oListItem (#857)
Part of #756
1 parent 400f3fd commit 116ab69

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed

src/CSSList/CSSList.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,37 +62,37 @@ public function __construct($lineNumber = 0)
6262
* @throws UnexpectedTokenException
6363
* @throws SourceException
6464
*/
65-
public static function parseList(ParserState $parserState, CSSList $oList): void
65+
public static function parseList(ParserState $parserState, CSSList $list): void
6666
{
67-
$bIsRoot = $oList instanceof Document;
67+
$bIsRoot = $list instanceof Document;
6868
if (\is_string($parserState)) {
6969
$parserState = new ParserState($parserState, Settings::create());
7070
}
7171
$bLenientParsing = $parserState->getSettings()->bLenientParsing;
7272
$comments = [];
7373
while (!$parserState->isEnd()) {
7474
$comments = \array_merge($comments, $parserState->consumeWhiteSpace());
75-
$oListItem = null;
75+
$listItem = null;
7676
if ($bLenientParsing) {
7777
try {
78-
$oListItem = self::parseListItem($parserState, $oList);
78+
$listItem = self::parseListItem($parserState, $list);
7979
} catch (UnexpectedTokenException $e) {
80-
$oListItem = false;
80+
$listItem = false;
8181
}
8282
} else {
83-
$oListItem = self::parseListItem($parserState, $oList);
83+
$listItem = self::parseListItem($parserState, $list);
8484
}
85-
if ($oListItem === null) {
85+
if ($listItem === null) {
8686
// List parsing finished
8787
return;
8888
}
89-
if ($oListItem) {
90-
$oListItem->addComments($comments);
91-
$oList->append($oListItem);
89+
if ($listItem) {
90+
$listItem->addComments($comments);
91+
$list->append($listItem);
9292
}
9393
$comments = $parserState->consumeWhiteSpace();
9494
}
95-
$oList->addComments($comments);
95+
$list->addComments($comments);
9696
if (!$bIsRoot && !$bLenientParsing) {
9797
throw new SourceException('Unexpected end of document', $parserState->currentLine());
9898
}
@@ -105,9 +105,9 @@ public static function parseList(ParserState $parserState, CSSList $oList): void
105105
* @throws UnexpectedEOFException
106106
* @throws UnexpectedTokenException
107107
*/
108-
private static function parseListItem(ParserState $parserState, CSSList $oList)
108+
private static function parseListItem(ParserState $parserState, CSSList $list)
109109
{
110-
$bIsRoot = $oList instanceof Document;
110+
$bIsRoot = $list instanceof Document;
111111
if ($parserState->comes('@')) {
112112
$oAtRule = self::parseAtRule($parserState);
113113
if ($oAtRule instanceof Charset) {
@@ -119,7 +119,7 @@ private static function parseListItem(ParserState $parserState, CSSList $oList)
119119
$parserState->currentLine()
120120
);
121121
}
122-
if (\count($oList->getContents()) > 0) {
122+
if (\count($list->getContents()) > 0) {
123123
throw new UnexpectedTokenException(
124124
'@charset must be the first parseable token in a document',
125125
'',
@@ -142,7 +142,7 @@ private static function parseListItem(ParserState $parserState, CSSList $oList)
142142
return null;
143143
}
144144
} else {
145-
return DeclarationBlock::parse($parserState, $oList);
145+
return DeclarationBlock::parse($parserState, $list);
146146
}
147147
}
148148

src/RuleSet/DeclarationBlock.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ public function __construct($lineNumber = 0)
3939
}
4040

4141
/**
42-
* @param CSSList|null $oList
42+
* @param CSSList|null $list
4343
*
4444
* @return DeclarationBlock|false
4545
*
4646
* @throws UnexpectedTokenException
4747
* @throws UnexpectedEOFException
4848
*/
49-
public static function parse(ParserState $parserState, $oList = null)
49+
public static function parse(ParserState $parserState, $list = null)
5050
{
5151
$comments = [];
5252
$oResult = new DeclarationBlock($parserState->currentLine());
@@ -64,7 +64,7 @@ public static function parse(ParserState $parserState, $oList = null)
6464
}
6565
}
6666
} while (!\in_array($parserState->peek(), ['{', '}'], true) || $sStringWrapperChar !== false);
67-
$oResult->setSelectors(\implode('', $aSelectorParts), $oList);
67+
$oResult->setSelectors(\implode('', $aSelectorParts), $list);
6868
if ($parserState->comes('{')) {
6969
$parserState->consume(1);
7070
}
@@ -85,11 +85,11 @@ public static function parse(ParserState $parserState, $oList = null)
8585

8686
/**
8787
* @param array<int, Selector|string>|string $mSelector
88-
* @param CSSList|null $oList
88+
* @param CSSList|null $list
8989
*
9090
* @throws UnexpectedTokenException
9191
*/
92-
public function setSelectors($mSelector, $oList = null): void
92+
public function setSelectors($mSelector, $list = null): void
9393
{
9494
if (\is_array($mSelector)) {
9595
$this->aSelectors = $mSelector;
@@ -98,7 +98,7 @@ public function setSelectors($mSelector, $oList = null): void
9898
}
9999
foreach ($this->aSelectors as $key => $mSelector) {
100100
if (!($mSelector instanceof Selector)) {
101-
if ($oList === null || !($oList instanceof KeyFrame)) {
101+
if ($list === null || !($list instanceof KeyFrame)) {
102102
if (!Selector::isValid($mSelector)) {
103103
throw new UnexpectedTokenException(
104104
"Selector did not match '" . Selector::SELECTOR_VALIDATION_RX . "'.",

src/Value/CalcFunction.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static function parse(ParserState $parserState, bool $bIgnoreCase = false
3737
}
3838
$parserState->consume('(');
3939
$oCalcList = new CalcRuleValueList($parserState->currentLine());
40-
$oList = new RuleValueList(',', $parserState->currentLine());
40+
$list = new RuleValueList(',', $parserState->currentLine());
4141
$iNestingLevel = 0;
4242
$iLastComponentType = null;
4343
while (!$parserState->comes(')') || $iNestingLevel > 0) {
@@ -94,10 +94,10 @@ public static function parse(ParserState $parserState, bool $bIgnoreCase = false
9494
}
9595
$parserState->consumeWhiteSpace();
9696
}
97-
$oList->addListComponent($oCalcList);
97+
$list->addListComponent($oCalcList);
9898
if (!$parserState->isEnd()) {
9999
$parserState->consume(')');
100100
}
101-
return new CalcFunction($sFunction, $oList, ',', $parserState->currentLine());
101+
return new CalcFunction($sFunction, $list, ',', $parserState->currentLine());
102102
}
103103
}

src/Value/Value.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,11 @@ public static function parseValue(ParserState $parserState, array $aListDelimite
8585
break;
8686
}
8787
}
88-
$oList = new RuleValueList($sDelimiter, $parserState->currentLine());
88+
$list = new RuleValueList($sDelimiter, $parserState->currentLine());
8989
for ($i = $iStartPosition; $i - $iStartPosition < $iLength * 2; $i += 2) {
90-
$oList->addListComponent($aStack[$i]);
90+
$list->addListComponent($aStack[$i]);
9191
}
92-
$aNewStack[] = $oList;
92+
$aNewStack[] = $list;
9393
$iStartPosition += $iLength * 2 - 2;
9494
}
9595
$aStack = $aNewStack;

0 commit comments

Comments
 (0)