diff --git a/src/CSSList/CSSList.php b/src/CSSList/CSSList.php index 898983cf..092121a9 100644 --- a/src/CSSList/CSSList.php +++ b/src/CSSList/CSSList.php @@ -62,9 +62,9 @@ public function __construct($lineNumber = 0) * @throws UnexpectedTokenException * @throws SourceException */ - public static function parseList(ParserState $parserState, CSSList $oList): void + public static function parseList(ParserState $parserState, CSSList $list): void { - $bIsRoot = $oList instanceof Document; + $bIsRoot = $list instanceof Document; if (\is_string($parserState)) { $parserState = new ParserState($parserState, Settings::create()); } @@ -72,27 +72,27 @@ public static function parseList(ParserState $parserState, CSSList $oList): void $comments = []; while (!$parserState->isEnd()) { $comments = \array_merge($comments, $parserState->consumeWhiteSpace()); - $oListItem = null; + $listItem = null; if ($bLenientParsing) { try { - $oListItem = self::parseListItem($parserState, $oList); + $listItem = self::parseListItem($parserState, $list); } catch (UnexpectedTokenException $e) { - $oListItem = false; + $listItem = false; } } else { - $oListItem = self::parseListItem($parserState, $oList); + $listItem = self::parseListItem($parserState, $list); } - if ($oListItem === null) { + if ($listItem === null) { // List parsing finished return; } - if ($oListItem) { - $oListItem->addComments($comments); - $oList->append($oListItem); + if ($listItem) { + $listItem->addComments($comments); + $list->append($listItem); } $comments = $parserState->consumeWhiteSpace(); } - $oList->addComments($comments); + $list->addComments($comments); if (!$bIsRoot && !$bLenientParsing) { throw new SourceException('Unexpected end of document', $parserState->currentLine()); } @@ -105,9 +105,9 @@ public static function parseList(ParserState $parserState, CSSList $oList): void * @throws UnexpectedEOFException * @throws UnexpectedTokenException */ - private static function parseListItem(ParserState $parserState, CSSList $oList) + private static function parseListItem(ParserState $parserState, CSSList $list) { - $bIsRoot = $oList instanceof Document; + $bIsRoot = $list instanceof Document; if ($parserState->comes('@')) { $oAtRule = self::parseAtRule($parserState); if ($oAtRule instanceof Charset) { @@ -119,7 +119,7 @@ private static function parseListItem(ParserState $parserState, CSSList $oList) $parserState->currentLine() ); } - if (\count($oList->getContents()) > 0) { + if (\count($list->getContents()) > 0) { throw new UnexpectedTokenException( '@charset must be the first parseable token in a document', '', @@ -142,7 +142,7 @@ private static function parseListItem(ParserState $parserState, CSSList $oList) return null; } } else { - return DeclarationBlock::parse($parserState, $oList); + return DeclarationBlock::parse($parserState, $list); } } diff --git a/src/RuleSet/DeclarationBlock.php b/src/RuleSet/DeclarationBlock.php index c0c26fc5..75b62879 100644 --- a/src/RuleSet/DeclarationBlock.php +++ b/src/RuleSet/DeclarationBlock.php @@ -39,14 +39,14 @@ public function __construct($lineNumber = 0) } /** - * @param CSSList|null $oList + * @param CSSList|null $list * * @return DeclarationBlock|false * * @throws UnexpectedTokenException * @throws UnexpectedEOFException */ - public static function parse(ParserState $parserState, $oList = null) + public static function parse(ParserState $parserState, $list = null) { $comments = []; $oResult = new DeclarationBlock($parserState->currentLine()); @@ -64,7 +64,7 @@ public static function parse(ParserState $parserState, $oList = null) } } } while (!\in_array($parserState->peek(), ['{', '}'], true) || $sStringWrapperChar !== false); - $oResult->setSelectors(\implode('', $aSelectorParts), $oList); + $oResult->setSelectors(\implode('', $aSelectorParts), $list); if ($parserState->comes('{')) { $parserState->consume(1); } @@ -85,11 +85,11 @@ public static function parse(ParserState $parserState, $oList = null) /** * @param array|string $mSelector - * @param CSSList|null $oList + * @param CSSList|null $list * * @throws UnexpectedTokenException */ - public function setSelectors($mSelector, $oList = null): void + public function setSelectors($mSelector, $list = null): void { if (\is_array($mSelector)) { $this->aSelectors = $mSelector; @@ -98,7 +98,7 @@ public function setSelectors($mSelector, $oList = null): void } foreach ($this->aSelectors as $iKey => $mSelector) { if (!($mSelector instanceof Selector)) { - if ($oList === null || !($oList instanceof KeyFrame)) { + if ($list === null || !($list instanceof KeyFrame)) { if (!Selector::isValid($mSelector)) { throw new UnexpectedTokenException( "Selector did not match '" . Selector::SELECTOR_VALIDATION_RX . "'.", diff --git a/src/Value/CalcFunction.php b/src/Value/CalcFunction.php index 8288c7cd..5d84a9a8 100644 --- a/src/Value/CalcFunction.php +++ b/src/Value/CalcFunction.php @@ -37,7 +37,7 @@ public static function parse(ParserState $parserState, bool $bIgnoreCase = false } $parserState->consume('('); $oCalcList = new CalcRuleValueList($parserState->currentLine()); - $oList = new RuleValueList(',', $parserState->currentLine()); + $list = new RuleValueList(',', $parserState->currentLine()); $iNestingLevel = 0; $iLastComponentType = null; while (!$parserState->comes(')') || $iNestingLevel > 0) { @@ -94,10 +94,10 @@ public static function parse(ParserState $parserState, bool $bIgnoreCase = false } $parserState->consumeWhiteSpace(); } - $oList->addListComponent($oCalcList); + $list->addListComponent($oCalcList); if (!$parserState->isEnd()) { $parserState->consume(')'); } - return new CalcFunction($sFunction, $oList, ',', $parserState->currentLine()); + return new CalcFunction($sFunction, $list, ',', $parserState->currentLine()); } } diff --git a/src/Value/Value.php b/src/Value/Value.php index b11c1085..7ba2a7e2 100644 --- a/src/Value/Value.php +++ b/src/Value/Value.php @@ -85,11 +85,11 @@ public static function parseValue(ParserState $parserState, array $aListDelimite break; } } - $oList = new RuleValueList($sDelimiter, $parserState->currentLine()); + $list = new RuleValueList($sDelimiter, $parserState->currentLine()); for ($i = $iStartPosition; $i - $iStartPosition < $iLength * 2; $i += 2) { - $oList->addListComponent($aStack[$i]); + $list->addListComponent($aStack[$i]); } - $aNewStack[] = $oList; + $aNewStack[] = $list; $iStartPosition += $iLength * 2 - 2; } $aStack = $aNewStack;