diff --git a/src/Value/Color.php b/src/Value/Color.php index 482495981..16e7dbd86 100644 --- a/src/Value/Color.php +++ b/src/Value/Color.php @@ -32,8 +32,8 @@ public static function parse(ParserState $parserState, bool $ignoreCase = false) { return $parserState->comes('#') - ? self::parseHexColor($parserState) - : self::parseColorFunction($parserState); + ? self::parseHexColor($parserState) + : self::parseColorFunction($parserState); } /** @@ -138,8 +138,8 @@ private static function parseColorFunction(ParserState $parserState): CSSFunctio // With a `var` argument, the function can have fewer arguments. // And as of CSS Color Module Level 4, the alpha argument is optional. $canCloseNow = - $containsVar || - ($mayHaveOptionalAlpha && $argumentIndex >= $expectedArgumentCount - 2); + $containsVar + || ($mayHaveOptionalAlpha && $argumentIndex >= $expectedArgumentCount - 2); if ($canCloseNow && $parserState->comes(')')) { break; } @@ -183,8 +183,8 @@ private static function parseColorFunction(ParserState $parserState): CSSFunctio return $containsVar - ? new CSSFunction($colorMode, \array_values($colorValues), ',', $parserState->currentLine()) - : new Color($colorValues, $parserState->currentLine()); + ? new CSSFunction($colorMode, \array_values($colorValues), ',', $parserState->currentLine()) + : new Color($colorValues, $parserState->currentLine()); } private static function mapRange(float $value, float $fromMin, float $fromMax, float $toMin, float $toMax): float diff --git a/src/Value/Value.php b/src/Value/Value.php index b5c20c996..4e27b668c 100644 --- a/src/Value/Value.php +++ b/src/Value/Value.php @@ -46,10 +46,10 @@ public static function parseValue(ParserState $parserState, array $aListDelimite $parserState->consumeWhiteSpace(); //Build a list of delimiters and parsed values while ( - !($parserState->comes('}') || $parserState->comes(';') || $parserState->comes('!') - || $parserState->comes(')') - || $parserState->comes('\\') - || $parserState->isEnd()) + !($parserState->comes('}') || $parserState->comes(';') || $parserState->comes('!') + || $parserState->comes(')') + || $parserState->comes('\\') + || $parserState->isEnd()) ) { if (\count($aStack) > 0) { $bFoundDelimiter = false; diff --git a/tests/ParserTest.php b/tests/ParserTest.php index 15e663b71..15d152a4a 100644 --- a/tests/ParserTest.php +++ b/tests/ParserTest.php @@ -24,7 +24,6 @@ use Sabberworm\CSS\Value\Color; use Sabberworm\CSS\Value\Size; use Sabberworm\CSS\Value\URL; -use Sabberworm\CSS\Value\Value; use Sabberworm\CSS\Value\ValueList; /** diff --git a/tests/Unit/Rule/RuleTest.php b/tests/Unit/Rule/RuleTest.php index 604ace1c5..b803c6853 100644 --- a/tests/Unit/Rule/RuleTest.php +++ b/tests/Unit/Rule/RuleTest.php @@ -6,8 +6,8 @@ use PHPUnit\Framework\TestCase; use Sabberworm\CSS\Parsing\ParserState; -use Sabberworm\CSS\Settings; use Sabberworm\CSS\Rule\Rule; +use Sabberworm\CSS\Settings; use Sabberworm\CSS\Value\RuleValueList; use Sabberworm\CSS\Value\Value; use Sabberworm\CSS\Value\ValueList;