Skip to content

Commit c99ccf4

Browse files
committed
Code refactor for CI
1 parent f7019f8 commit c99ccf4

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

src/Value/CSSFunction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static function parse(ParserState $oParserState, $bIgnoreCase = false)
4747
{
4848
$mResult = $oParserState->parseIdentifier($bIgnoreCase);
4949
$oParserState->consume('(');
50-
$aArguments = Value::parseValue($oParserState, array('=', ' ', ','));
50+
$aArguments = Value::parseValue($oParserState, ['=', ' ', ',']);
5151
$mResult = new CSSFunction($mResult, $aArguments, ',', $oParserState->currentLine());
5252
$oParserState->consume(')');
5353
return $mResult;

src/Value/CalcFunction.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static function parse(ParserState $oParserState, $bIgnoreCase = false)
3434
if ($oParserState->peek() != '(') {
3535
// Found ; or end of line before an opening bracket
3636
throw new UnexpectedTokenException('(', $oParserState->peek(), 'literal', $oParserState->currentLine());
37-
} else if (!in_array($sFunction, array('calc', '-moz-calc', '-webkit-calc'))) {
37+
} elseif (!in_array($sFunction, ['calc', '-moz-calc', '-webkit-calc'])) {
3838
// Found invalid calc definition. Example calc (...
3939
throw new UnexpectedTokenException('calc', $sFunction, 'literal', $oParserState->currentLine());
4040
}
@@ -44,7 +44,10 @@ public static function parse(ParserState $oParserState, $bIgnoreCase = false)
4444
$iNestingLevel = 0;
4545
$iLastComponentType = null;
4646
while (!$oParserState->comes(')') || $iNestingLevel > 0) {
47-
if ($oParserState->isEnd() && $iNestingLevel === 0) break;
47+
if ($oParserState->isEnd() && $iNestingLevel === 0) {
48+
break;
49+
}
50+
4851
$oParserState->consumeWhiteSpace();
4952
if ($oParserState->comes('(')) {
5053
$iNestingLevel++;

src/Value/Value.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,11 @@ public static function parseIdentifierOrFunction(ParserState $oParserState, $bIg
113113
$oAnchor->backtrack();
114114
if ($oParserState->streql('url', $mResult)) {
115115
$mResult = URL::parse($oParserState);
116-
} else if ($oParserState->streql('calc', $mResult) || $oParserState->streql('-webkit-calc', $mResult) || $oParserState->streql('-moz-calc', $mResult)) {
116+
} elseif (
117+
$oParserState->streql('calc', $mResult)
118+
|| $oParserState->streql('-webkit-calc', $mResult)
119+
|| $oParserState->streql('-moz-calc', $mResult)
120+
) {
117121
$mResult = CalcFunction::parse($oParserState);
118122
} else {
119123
$mResult = CSSFunction::parse($oParserState, $bIgnoreCase);

tests/ParserTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,7 @@ public function lonelyImport()
12251225
self::assertSame($sExpected, $oDoc->render());
12261226
}
12271227

1228-
public function testEscapedSpecialCaseTokens()
1228+
public function escapedSpecialCaseTokens()
12291229
{
12301230
$oDoc = $this->parsedStructureForFile('escaped-tokens');
12311231
$contents = $oDoc->getContents();

0 commit comments

Comments
 (0)