From aa578c9a2235103a835f761f82e276c037f53d9c Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Sat, 26 Oct 2024 10:04:25 +0200 Subject: [PATCH 1/2] [CLEANUP] Autoformat the code --- src/Parsing/ParserState.php | 1 - src/Value/Size.php | 19 +++++++++++---- tests/CSSList/AtRuleBlockListTest.php | 22 +++++++++-------- tests/ParserTest.php | 5 +++- tests/Value/SizeTest.php | 34 ++++++++++++++++++++++----- 5 files changed, 59 insertions(+), 22 deletions(-) diff --git a/src/Parsing/ParserState.php b/src/Parsing/ParserState.php index b69e1309..fa146d7e 100644 --- a/src/Parsing/ParserState.php +++ b/src/Parsing/ParserState.php @@ -117,7 +117,6 @@ public function getSettings() return $this->oParserSettings; } - public function anchor(): Anchor { return new Anchor($this->iCurrentPosition, $this); diff --git a/src/Value/Size.php b/src/Value/Size.php index 31574720..0ba4bd66 100644 --- a/src/Value/Size.php +++ b/src/Value/Size.php @@ -20,10 +20,21 @@ class Size extends PrimitiveValue * @var array */ private 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', ]; /** diff --git a/tests/CSSList/AtRuleBlockListTest.php b/tests/CSSList/AtRuleBlockListTest.php index f996ff82..e418f98f 100644 --- a/tests/CSSList/AtRuleBlockListTest.php +++ b/tests/CSSList/AtRuleBlockListTest.php @@ -35,17 +35,19 @@ public static function provideSyntacticallyCorrectAtRule(): array return [ 'media print' => ['@media print { html { background: white; color: black; } }'], 'keyframes' => ['@keyframes mymove { from { top: 0px; } }'], - 'supports' => [' - @supports (display: flex) { - .flex-container > * { - text-shadow: 0 0 2px blue; - float: none; + 'supports' => [ + ' + @supports (display: flex) { + .flex-container > * { + text-shadow: 0 0 2px blue; + float: none; + } + .flex-container { + display: flex; + } } - .flex-container { - display: flex; - } - } - '], + ', + ], ]; } diff --git a/tests/ParserTest.php b/tests/ParserTest.php index dcbcc1c0..e57511ff 100644 --- a/tests/ParserTest.php +++ b/tests/ParserTest.php @@ -755,7 +755,10 @@ public function emptyGridLineNameLenientInFile(): void */ public function invalidGridLineNameInFile(): void { - $document = self::parsedStructureForFile('invalid-grid-linename', Settings::create()->withMultibyteSupport(true)); + $document = self::parsedStructureForFile( + 'invalid-grid-linename', + Settings::create()->withMultibyteSupport(true) + ); $expected = 'div {}'; self::assertSame($expected, $document->render()); } diff --git a/tests/Value/SizeTest.php b/tests/Value/SizeTest.php index 6a05c3e9..d4c5438a 100644 --- a/tests/Value/SizeTest.php +++ b/tests/Value/SizeTest.php @@ -20,12 +20,34 @@ final class SizeTest extends TestCase public static function provideUnit(): array { $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( From 5596ade1437651f8c7decb91e17e9d1dd1c0905c Mon Sep 17 00:00:00 2001 From: Oliver Klee Date: Thu, 31 Oct 2024 08:51:25 +0100 Subject: [PATCH 2/2] Update tests/CSSList/AtRuleBlockListTest.php Co-authored-by: JakeQZ --- tests/CSSList/AtRuleBlockListTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/CSSList/AtRuleBlockListTest.php b/tests/CSSList/AtRuleBlockListTest.php index e418f98f..73e6c38b 100644 --- a/tests/CSSList/AtRuleBlockListTest.php +++ b/tests/CSSList/AtRuleBlockListTest.php @@ -46,7 +46,7 @@ public static function provideSyntacticallyCorrectAtRule(): array display: flex; } } - ', + ', ], ]; }