Skip to content

Commit b584760

Browse files
authored
[CLEANUP] Avoid Hungarian notation for sIdentifier (#863)
Part of #756
1 parent 95005c9 commit b584760

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/CSSList/CSSList.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ private static function parseListItem(ParserState $parserState, CSSList $list)
156156
private static function parseAtRule(ParserState $parserState)
157157
{
158158
$parserState->consume('@');
159-
$sIdentifier = $parserState->parseIdentifier();
159+
$identifier = $parserState->parseIdentifier();
160160
$iIdentifierLineNum = $parserState->currentLine();
161161
$parserState->consumeWhiteSpace();
162-
if ($sIdentifier === 'import') {
162+
if ($identifier === 'import') {
163163
$oLocation = URL::parse($parserState);
164164
$parserState->consumeWhiteSpace();
165165
$mediaQuery = null;
@@ -171,21 +171,21 @@ private static function parseAtRule(ParserState $parserState)
171171
}
172172
$parserState->consumeUntil([';', ParserState::EOF], true, true);
173173
return new Import($oLocation, $mediaQuery, $iIdentifierLineNum);
174-
} elseif ($sIdentifier === 'charset') {
174+
} elseif ($identifier === 'charset') {
175175
$oCharsetString = CSSString::parse($parserState);
176176
$parserState->consumeWhiteSpace();
177177
$parserState->consumeUntil([';', ParserState::EOF], true, true);
178178
return new Charset($oCharsetString, $iIdentifierLineNum);
179-
} elseif (self::identifierIs($sIdentifier, 'keyframes')) {
179+
} elseif (self::identifierIs($identifier, 'keyframes')) {
180180
$oResult = new KeyFrame($iIdentifierLineNum);
181-
$oResult->setVendorKeyFrame($sIdentifier);
181+
$oResult->setVendorKeyFrame($identifier);
182182
$oResult->setAnimationName(\trim($parserState->consumeUntil('{', false, true)));
183183
CSSList::parseList($parserState, $oResult);
184184
if ($parserState->comes('}')) {
185185
$parserState->consume('}');
186186
}
187187
return $oResult;
188-
} elseif ($sIdentifier === 'namespace') {
188+
} elseif ($identifier === 'namespace') {
189189
$sPrefix = null;
190190
$mUrl = Value::parsePrimitiveValue($parserState);
191191
if (!$parserState->comes(';')) {
@@ -217,16 +217,16 @@ private static function parseAtRule(ParserState $parserState)
217217
}
218218
$bUseRuleSet = true;
219219
foreach (\explode('/', AtRule::BLOCK_RULES) as $sBlockRuleName) {
220-
if (self::identifierIs($sIdentifier, $sBlockRuleName)) {
220+
if (self::identifierIs($identifier, $sBlockRuleName)) {
221221
$bUseRuleSet = false;
222222
break;
223223
}
224224
}
225225
if ($bUseRuleSet) {
226-
$oAtRule = new AtRuleSet($sIdentifier, $sArgs, $iIdentifierLineNum);
226+
$oAtRule = new AtRuleSet($identifier, $sArgs, $iIdentifierLineNum);
227227
RuleSet::parseRuleSet($parserState, $oAtRule);
228228
} else {
229-
$oAtRule = new AtRuleBlockList($sIdentifier, $sArgs, $iIdentifierLineNum);
229+
$oAtRule = new AtRuleBlockList($identifier, $sArgs, $iIdentifierLineNum);
230230
CSSList::parseList($parserState, $oAtRule);
231231
if ($parserState->comes('}')) {
232232
$parserState->consume('}');
@@ -240,12 +240,12 @@ private static function parseAtRule(ParserState $parserState)
240240
* Tests an identifier for a given value. Since identifiers are all keywords, they can be vendor-prefixed.
241241
* We need to check for these versions too.
242242
*
243-
* @param string $sIdentifier
243+
* @param string $identifier
244244
*/
245-
private static function identifierIs($sIdentifier, string $sMatch): bool
245+
private static function identifierIs($identifier, string $sMatch): bool
246246
{
247-
return (\strcasecmp($sIdentifier, $sMatch) === 0)
248-
?: \preg_match("/^(-\\w+-)?$sMatch$/i", $sIdentifier) === 1;
247+
return (\strcasecmp($identifier, $sMatch) === 0)
248+
?: \preg_match("/^(-\\w+-)?$sMatch$/i", $identifier) === 1;
249249
}
250250

251251
/**

src/Value/URL.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@ public function __construct(CSSString $oURL, $lineNumber = 0)
3737
public static function parse(ParserState $parserState): URL
3838
{
3939
$oAnchor = $parserState->anchor();
40-
$sIdentifier = '';
40+
$identifier = '';
4141
for ($i = 0; $i < 3; $i++) {
4242
$sChar = $parserState->parseCharacter(true);
4343
if ($sChar === null) {
4444
break;
4545
}
46-
$sIdentifier .= $sChar;
46+
$identifier .= $sChar;
4747
}
48-
$bUseUrl = $parserState->streql($sIdentifier, 'url');
48+
$bUseUrl = $parserState->streql($identifier, 'url');
4949
if ($bUseUrl) {
5050
$parserState->consumeWhiteSpace();
5151
$parserState->consume('(');

0 commit comments

Comments
 (0)