Skip to content

Commit 4322d97

Browse files
authored
[CLEANUP] Autoformat the code and organize the imports (#899)
1 parent ceec94e commit 4322d97

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

src/Value/Color.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ public static function parse(ParserState $parserState, bool $ignoreCase = false)
3232
{
3333
return
3434
$parserState->comes('#')
35-
? self::parseHexColor($parserState)
36-
: self::parseColorFunction($parserState);
35+
? self::parseHexColor($parserState)
36+
: self::parseColorFunction($parserState);
3737
}
3838

3939
/**
@@ -138,8 +138,8 @@ private static function parseColorFunction(ParserState $parserState): CSSFunctio
138138
// With a `var` argument, the function can have fewer arguments.
139139
// And as of CSS Color Module Level 4, the alpha argument is optional.
140140
$canCloseNow =
141-
$containsVar ||
142-
($mayHaveOptionalAlpha && $argumentIndex >= $expectedArgumentCount - 2);
141+
$containsVar
142+
|| ($mayHaveOptionalAlpha && $argumentIndex >= $expectedArgumentCount - 2);
143143
if ($canCloseNow && $parserState->comes(')')) {
144144
break;
145145
}
@@ -183,8 +183,8 @@ private static function parseColorFunction(ParserState $parserState): CSSFunctio
183183

184184
return
185185
$containsVar
186-
? new CSSFunction($colorMode, \array_values($colorValues), ',', $parserState->currentLine())
187-
: new Color($colorValues, $parserState->currentLine());
186+
? new CSSFunction($colorMode, \array_values($colorValues), ',', $parserState->currentLine())
187+
: new Color($colorValues, $parserState->currentLine());
188188
}
189189

190190
private static function mapRange(float $value, float $fromMin, float $fromMax, float $toMin, float $toMax): float

src/Value/Value.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ public static function parseValue(ParserState $parserState, array $aListDelimite
4646
$parserState->consumeWhiteSpace();
4747
//Build a list of delimiters and parsed values
4848
while (
49-
!($parserState->comes('}') || $parserState->comes(';') || $parserState->comes('!')
50-
|| $parserState->comes(')')
51-
|| $parserState->comes('\\')
52-
|| $parserState->isEnd())
49+
!($parserState->comes('}') || $parserState->comes(';') || $parserState->comes('!')
50+
|| $parserState->comes(')')
51+
|| $parserState->comes('\\')
52+
|| $parserState->isEnd())
5353
) {
5454
if (\count($aStack) > 0) {
5555
$bFoundDelimiter = false;

tests/ParserTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
use Sabberworm\CSS\Value\Color;
2525
use Sabberworm\CSS\Value\Size;
2626
use Sabberworm\CSS\Value\URL;
27-
use Sabberworm\CSS\Value\Value;
2827
use Sabberworm\CSS\Value\ValueList;
2928

3029
/**

tests/Unit/Rule/RuleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
use PHPUnit\Framework\TestCase;
88
use Sabberworm\CSS\Parsing\ParserState;
9-
use Sabberworm\CSS\Settings;
109
use Sabberworm\CSS\Rule\Rule;
10+
use Sabberworm\CSS\Settings;
1111
use Sabberworm\CSS\Value\RuleValueList;
1212
use Sabberworm\CSS\Value\Value;
1313
use Sabberworm\CSS\Value\ValueList;

0 commit comments

Comments
 (0)