Skip to content

Commit e0100f7

Browse files
authored
[TASK] Switch to PER coding style 3.0 (#1585)
https://www.php-fig.org/per/coding-style/
1 parent a9e7b09 commit e0100f7

6 files changed

Lines changed: 15 additions & 15 deletions

File tree

Build/php-cs-fixer/config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
->setRiskyAllowed(true)
99
->setRules(
1010
[
11-
'@PER-CS2x0' => true,
12-
'@PER-CS2x0:risky' => true,
11+
'@PER-CS3x0' => true,
12+
'@PER-CS3x0:risky' => true,
1313

1414
'@PHPUnit5x0Migration:risky' => true,
1515
'@PHPUnit5x2Migration:risky' => true,

src/RuleSet/RuleSet.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ public function addDeclaration(Declaration $declarationToAdd, ?Declaration $sibl
136136
foreach ($this->declarations as $declarationsForAProperty) {
137137
foreach ($declarationsForAProperty as $declaration) {
138138
if (
139-
$declaration->getLineNumber() === $siblingLineNumber &&
140-
$declaration->getColumnNumber() >= $siblingColumnNumber
139+
$declaration->getLineNumber() === $siblingLineNumber
140+
&& $declaration->getColumnNumber() >= $siblingColumnNumber
141141
) {
142142
$declaration->setPosition($siblingLineNumber, $declaration->getColumnNumber() + 1);
143143
}

src/Value/Color.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ private static function parseColorFunction(ParserState $parserState): CSSFunctio
138138

139139
// With a `var` argument, the function can have fewer arguments.
140140
// And as of CSS Color Module Level 4, the alpha argument is optional.
141-
$canCloseNow =
142-
$containsVar
141+
$canCloseNow
142+
= $containsVar
143143
|| ($mayHaveOptionalAlpha && $argumentIndex >= $expectedArgumentCount - 2);
144144
if ($canCloseNow && $parserState->comes(')')) {
145145
break;

tests/Comment/CommentTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ public function stripCommentsFromOutput(): void
5959

6060
$expected1 = "\n"
6161
. "@import url(\"some/url.css\") screen;\n\n"
62-
. ".foo, #bar {\n" .
63-
"\tbackground-color: #000;\n"
62+
. ".foo, #bar {\n"
63+
. "\tbackground-color: #000;\n"
6464
. "}\n\n"
6565
. "@media screen {\n"
6666
. "\t#foo.bar {\n"

tests/Unit/RuleSet/DeclarationListTests.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,8 +295,8 @@ public static function provideInitialPropertyNamesAndIndexOfOne(): array
295295
foreach ($initialPropertyNamesSets as $setName => $data) {
296296
$initialPropertyNames = $data[0];
297297
for ($index = 0; $index < \count($initialPropertyNames); ++$index) {
298-
$initialPropertyNamesAndIndexSets[$setName . ', index ' . $index] =
299-
[$initialPropertyNames, $index];
298+
$initialPropertyNamesAndIndexSets[$setName . ', index ' . $index]
299+
= [$initialPropertyNames, $index];
300300
}
301301
}
302302

tests/Unit/Value/CSSStringTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ public function getArrayRepresentationIncludesContents(): void
112112
*/
113113
public function doesNotEscapeSingleQuotesThatDoNotNeedToBeEscaped(): void
114114
{
115-
$input = "data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none'" .
116-
" xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd'" .
117-
" d='M14.3145 2 3V11.9987H17.5687L18 8.20761H14.3145L14.32 6.31012C14.32 5.32134 14.4207" .
118-
' 4.79153 15.9426 4.79153H17.977V1H14.7223C10.8129 1 9.43687 2.83909 9.43687 ' .
119-
" 5.93187V8.20804H7V11.9991H9.43687V23H14.3145Z' fill='black'/%3E%3C/svg%3E%0A";
115+
$input = "data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none'"
116+
. " xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd'"
117+
. " d='M14.3145 2 3V11.9987H17.5687L18 8.20761H14.3145L14.32 6.31012C14.32 5.32134 14.4207"
118+
. ' 4.79153 15.9426 4.79153H17.977V1H14.7223C10.8129 1 9.43687 2.83909 9.43687 '
119+
. " 5.93187V8.20804H7V11.9991H9.43687V23H14.3145Z' fill='black'/%3E%3C/svg%3E%0A";
120120

121121
$outputFormat = OutputFormat::createPretty();
122122

0 commit comments

Comments
 (0)