Skip to content

Commit 5fc7fb4

Browse files
committed
[CLEANUP] Avoid Hungarian notation for aComments
Part of #756
1 parent e24aa71 commit 5fc7fb4

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

src/CSSList/CSSList.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ public static function parseList(ParserState $parserState, CSSList $oList): void
6969
$parserState = new ParserState($parserState, Settings::create());
7070
}
7171
$bLenientParsing = $parserState->getSettings()->bLenientParsing;
72-
$aComments = [];
72+
$comments = [];
7373
while (!$parserState->isEnd()) {
74-
$aComments = \array_merge($aComments, $parserState->consumeWhiteSpace());
74+
$comments = \array_merge($comments, $parserState->consumeWhiteSpace());
7575
$oListItem = null;
7676
if ($bLenientParsing) {
7777
try {
@@ -87,12 +87,12 @@ public static function parseList(ParserState $parserState, CSSList $oList): void
8787
return;
8888
}
8989
if ($oListItem) {
90-
$oListItem->addComments($aComments);
90+
$oListItem->addComments($comments);
9191
$oList->append($oListItem);
9292
}
93-
$aComments = $parserState->consumeWhiteSpace();
93+
$comments = $parserState->consumeWhiteSpace();
9494
}
95-
$oList->addComments($aComments);
95+
$oList->addComments($comments);
9696
if (!$bIsRoot && !$bLenientParsing) {
9797
throw new SourceException('Unexpected end of document', $parserState->currentLine());
9898
}

src/OutputFormatter.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ public function removeLastSemicolon($sString)
179179
}
180180

181181
/**
182-
* @param array<Commentable> $aComments
182+
* @param array<Commentable> $comments
183183
*
184184
* @return string
185185
*/
@@ -190,10 +190,10 @@ public function comments(Commentable $oCommentable): string
190190
}
191191

192192
$sResult = '';
193-
$aComments = $oCommentable->getComments();
194-
$iLastCommentIndex = \count($aComments) - 1;
193+
$comments = $oCommentable->getComments();
194+
$iLastCommentIndex = \count($comments) - 1;
195195

196-
foreach ($aComments as $i => $oComment) {
196+
foreach ($comments as $i => $oComment) {
197197
$sResult .= $oComment->render($this->oFormat);
198198
$sResult .= $i === $iLastCommentIndex ? $this->spaceAfterBlocks() : $this->spaceBetweenBlocks();
199199
}

src/Parsing/ParserState.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public function parseCharacter($bIsForIdentifier)
231231
*/
232232
public function consumeWhiteSpace(): array
233233
{
234-
$aComments = [];
234+
$comments = [];
235235
do {
236236
while (\preg_match('/\\s/isSu', $this->peek()) === 1) {
237237
$this->consume(1);
@@ -241,16 +241,16 @@ public function consumeWhiteSpace(): array
241241
$oComment = $this->consumeComment();
242242
} catch (UnexpectedEOFException $e) {
243243
$this->iCurrentPosition = $this->iLength;
244-
return $aComments;
244+
return $comments;
245245
}
246246
} else {
247247
$oComment = $this->consumeComment();
248248
}
249249
if ($oComment !== false) {
250-
$aComments[] = $oComment;
250+
$comments[] = $oComment;
251251
}
252252
} while ($oComment !== false);
253-
return $aComments;
253+
return $comments;
254254
}
255255

256256
/**

src/Rule/Rule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ public function __construct($sRule, $lineNumber = 0, $iColNo = 0)
7878
*/
7979
public static function parse(ParserState $parserState): Rule
8080
{
81-
$aComments = $parserState->consumeWhiteSpace();
81+
$comments = $parserState->consumeWhiteSpace();
8282
$rule = new Rule(
8383
$parserState->parseIdentifier(!$parserState->comes('--')),
8484
$parserState->currentLine(),
8585
$parserState->currentColumn()
8686
);
87-
$rule->setComments($aComments);
87+
$rule->setComments($comments);
8888
$rule->addComments($parserState->consumeWhiteSpace());
8989
$parserState->consume(':');
9090
$oValue = Value::parseValue($parserState, self::listDelimiterForRule($rule->getRule()));

src/RuleSet/DeclarationBlock.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ public function __construct($lineNumber = 0)
4848
*/
4949
public static function parse(ParserState $parserState, $oList = null)
5050
{
51-
$aComments = [];
51+
$comments = [];
5252
$oResult = new DeclarationBlock($parserState->currentLine());
5353
try {
5454
$aSelectorParts = [];
5555
$sStringWrapperChar = false;
5656
do {
5757
$aSelectorParts[] = $parserState->consume(1)
58-
. $parserState->consumeUntil(['{', '}', '\'', '"'], false, false, $aComments);
58+
. $parserState->consumeUntil(['{', '}', '\'', '"'], false, false, $comments);
5959
if (\in_array($parserState->peek(), ['\'', '"'], true) && \substr(\end($aSelectorParts), -1) != '\\') {
6060
if ($sStringWrapperChar === false) {
6161
$sStringWrapperChar = $parserState->peek();
@@ -78,7 +78,7 @@ public static function parse(ParserState $parserState, $oList = null)
7878
throw $e;
7979
}
8080
}
81-
$oResult->setComments($aComments);
81+
$oResult->setComments($comments);
8282
RuleSet::parseRuleSet($parserState, $oResult);
8383
return $oResult;
8484
}

0 commit comments

Comments
 (0)