Skip to content

Commit

Permalink
[CLEANUP] Autoformat the code
Browse files Browse the repository at this point in the history
This is the v8.x backport of #748.
  • Loading branch information
oliverklee committed Oct 26, 2024
1 parent 068853d commit 7353634
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 15 deletions.
19 changes: 15 additions & 4 deletions src/Value/Size.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,21 @@ class Size extends PrimitiveValue
* @internal
*/
const ABSOLUTE_SIZE_UNITS = [
'px', 'pt', 'pc',
'cm', 'mm', 'mozmm', 'in',
'vh', 'dvh', 'svh', 'lvh',
'vw', 'vmin', 'vmax', 'rem',
'px',
'pt',
'pc',
'cm',
'mm',
'mozmm',
'in',
'vh',
'dvh',
'svh',
'lvh',
'vw',
'vmin',
'vmax',
'rem',
];

/**
Expand Down
6 changes: 4 additions & 2 deletions tests/CSSList/AtRuleBlockListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public static function provideSyntacticlyCorrectAtRule()
return [
'media print' => ['@media print { html { background: white; color: black; } }'],
'keyframes' => ['@keyframes mymove { from { top: 0px; } }'],
'supports' => ['
'supports' => [
'
@supports (display: flex) {
.flex-container > * {
text-shadow: 0 0 2px blue;
Expand All @@ -43,7 +44,8 @@ public static function provideSyntacticlyCorrectAtRule()
display: flex;
}
}
'],
',
],
];
}

Expand Down
34 changes: 28 additions & 6 deletions tests/Value/SizeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,34 @@ final class SizeTest extends TestCase
public static function provideUnit()
{
$units = [
'px', 'pt', 'pc',
'cm', 'mm', 'mozmm', 'in',
'vh', 'dvh', 'svh', 'lvh',
'vw', 'vmin', 'vmax', 'rem',
'%', 'em', 'ex', 'ch', 'fr',
'deg', 'grad', 'rad', 's', 'ms', 'turn', 'Hz', 'kHz',
'px',
'pt',
'pc',
'cm',
'mm',
'mozmm',
'in',
'vh',
'dvh',
'svh',
'lvh',
'vw',
'vmin',
'vmax',
'rem',
'%',
'em',
'ex',
'ch',
'fr',
'deg',
'grad',
'rad',
's',
'ms',
'turn',
'Hz',
'kHz',
];

return \array_combine(
Expand Down
6 changes: 3 additions & 3 deletions tests/Value/ValueTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function parsesArithmeticInFunctions($operator)
{
$subject = Value::parseValue(new ParserState('max(300px, 50vh ' . $operator . ' 10px);', Settings::create()));

self::assertSame('max(300px,50vh ' . $operator . ' 10px)', (string) $subject);
self::assertSame('max(300px,50vh ' . $operator . ' 10px)', (string)$subject);
}

/**
Expand Down Expand Up @@ -74,7 +74,7 @@ public function parsesArithmeticWithMultipleOperatorsInFunctions(

$subject = Value::parseValue(new ParserState(\sprintf($parserTemplate, $expression), Settings::create()));

self::assertSame(\sprintf($expectedResultTemplate, $expression), (string) $subject);
self::assertSame(\sprintf($expectedResultTemplate, $expression), (string)$subject);
}

/**
Expand Down Expand Up @@ -102,6 +102,6 @@ public function parsesArithmeticWithMalformedOperandsInFunctions($leftOperand, $
Settings::create()
));

self::assertSame('max(300px,' . $leftOperand . ' + ' . $rightOperand . ')', (string) $subject);
self::assertSame('max(300px,' . $leftOperand . ' + ' . $rightOperand . ')', (string)$subject);
}
}

0 comments on commit 7353634

Please sign in to comment.