diff --git a/Build/php-cs-fixer/config.php b/Build/php-cs-fixer/config.php index 807b376f..9f24d676 100644 --- a/Build/php-cs-fixer/config.php +++ b/Build/php-cs-fixer/config.php @@ -8,8 +8,8 @@ ->setRiskyAllowed(true) ->setRules( [ - '@PER-CS2x0' => true, - '@PER-CS2x0:risky' => true, + '@PER-CS3x0' => true, + '@PER-CS3x0:risky' => true, '@PHPUnit5x0Migration:risky' => true, '@PHPUnit5x2Migration:risky' => true, diff --git a/src/RuleSet/RuleSet.php b/src/RuleSet/RuleSet.php index 35b6d6b8..b011c6a5 100644 --- a/src/RuleSet/RuleSet.php +++ b/src/RuleSet/RuleSet.php @@ -136,8 +136,8 @@ public function addDeclaration(Declaration $declarationToAdd, ?Declaration $sibl foreach ($this->declarations as $declarationsForAProperty) { foreach ($declarationsForAProperty as $declaration) { if ( - $declaration->getLineNumber() === $siblingLineNumber && - $declaration->getColumnNumber() >= $siblingColumnNumber + $declaration->getLineNumber() === $siblingLineNumber + && $declaration->getColumnNumber() >= $siblingColumnNumber ) { $declaration->setPosition($siblingLineNumber, $declaration->getColumnNumber() + 1); } diff --git a/src/Value/Color.php b/src/Value/Color.php index df491692..e79718f0 100644 --- a/src/Value/Color.php +++ b/src/Value/Color.php @@ -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 + $canCloseNow + = $containsVar || ($mayHaveOptionalAlpha && $argumentIndex >= $expectedArgumentCount - 2); if ($canCloseNow && $parserState->comes(')')) { break; diff --git a/tests/Comment/CommentTest.php b/tests/Comment/CommentTest.php index 042a509b..5a66ec08 100644 --- a/tests/Comment/CommentTest.php +++ b/tests/Comment/CommentTest.php @@ -59,8 +59,8 @@ public function stripCommentsFromOutput(): void $expected1 = "\n" . "@import url(\"some/url.css\") screen;\n\n" - . ".foo, #bar {\n" . - "\tbackground-color: #000;\n" + . ".foo, #bar {\n" + . "\tbackground-color: #000;\n" . "}\n\n" . "@media screen {\n" . "\t#foo.bar {\n" diff --git a/tests/Unit/RuleSet/DeclarationListTests.php b/tests/Unit/RuleSet/DeclarationListTests.php index f831e618..fb9c78d9 100644 --- a/tests/Unit/RuleSet/DeclarationListTests.php +++ b/tests/Unit/RuleSet/DeclarationListTests.php @@ -295,8 +295,8 @@ public static function provideInitialPropertyNamesAndIndexOfOne(): array foreach ($initialPropertyNamesSets as $setName => $data) { $initialPropertyNames = $data[0]; for ($index = 0; $index < \count($initialPropertyNames); ++$index) { - $initialPropertyNamesAndIndexSets[$setName . ', index ' . $index] = - [$initialPropertyNames, $index]; + $initialPropertyNamesAndIndexSets[$setName . ', index ' . $index] + = [$initialPropertyNames, $index]; } } diff --git a/tests/Unit/Value/CSSStringTest.php b/tests/Unit/Value/CSSStringTest.php index 6f6b5018..94196cfa 100644 --- a/tests/Unit/Value/CSSStringTest.php +++ b/tests/Unit/Value/CSSStringTest.php @@ -112,11 +112,11 @@ public function getArrayRepresentationIncludesContents(): void */ public function doesNotEscapeSingleQuotesThatDoNotNeedToBeEscaped(): void { - $input = "data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none'" . - " xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd'" . - " d='M14.3145 2 3V11.9987H17.5687L18 8.20761H14.3145L14.32 6.31012C14.32 5.32134 14.4207" . - ' 4.79153 15.9426 4.79153H17.977V1H14.7223C10.8129 1 9.43687 2.83909 9.43687 ' . - " 5.93187V8.20804H7V11.9991H9.43687V23H14.3145Z' fill='black'/%3E%3C/svg%3E%0A"; + $input = "data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none'" + . " xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd'" + . " d='M14.3145 2 3V11.9987H17.5687L18 8.20761H14.3145L14.32 6.31012C14.32 5.32134 14.4207" + . ' 4.79153 15.9426 4.79153H17.977V1H14.7223C10.8129 1 9.43687 2.83909 9.43687 ' + . " 5.93187V8.20804H7V11.9991H9.43687V23H14.3145Z' fill='black'/%3E%3C/svg%3E%0A"; $outputFormat = OutputFormat::createPretty();