Skip to content

Commit

Permalink
Enable the TrailingCommaInMultilineFixer for arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Aug 25, 2023
1 parent fe5195d commit 5366b34
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion config/contao.php
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@
$ecsConfig->rule(\PhpCsFixer\Fixer\Strict\StrictParamFixer::class);
$ecsConfig->ruleWithConfiguration(\PHP_CodeSniffer\Standards\Squiz\Sniffs\WhiteSpace\SuperfluousWhitespaceSniff::class, ['ignoreBlankLines' => false]);
$ecsConfig->rule(\PhpCsFixer\Fixer\Operator\TernaryToNullCoalescingFixer::class);
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class, ['elements' => ['arrays', 'parameters'], 'after_heredoc' => true]);
$ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class, ['elements' => ['arrays', 'arguments', 'match', 'parameters'], 'after_heredoc' => true]);
$ecsConfig->ruleWithConfiguration(\SlevomatCodingStandard\Sniffs\Classes\TraitUseSpacingSniff::class, ['linesCountAfterLastUse' => 1, 'linesCountAfterLastUseWhenLastInClass' => 0, 'linesCountBeforeFirstUse' => 0, 'linesCountBetweenUses' => 0]);
$ecsConfig->rule(\SlevomatCodingStandard\Sniffs\Functions\UnusedInheritedVariablePassedToClosureSniff::class);
$ecsConfig->ruleWithConfiguration(\SlevomatCodingStandard\Sniffs\Namespaces\UnusedUsesSniff::class, ['searchAnnotations' => true]);
Expand Down
4 changes: 2 additions & 2 deletions src/Fixer/AssertEqualsFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ public function testFoo(): void
$this->assertSame("foo", $obj->getName());
$this->assertEquals(new Foo(), $obj);
}
'
',
),
]
],
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Fixer/CaseCommentIndentationFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ public function getDefinition(): FixerDefinitionInterface
case 2:
break;
}
'
',
),
]
],
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/Fixer/ExpectsWithCallbackFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function () {
}
));
}
'
',
),
new CodeSample(
'<?php
Expand All @@ -63,9 +63,9 @@ function () {
)
);
}
'
',
),
]
],
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Fixer/InlinePhpdocCommentFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public function testFoo(): void
/** @var string $str */
$str = (new Foo())->get();
}
'
',
),
]
],
);
}

Expand Down
6 changes: 3 additions & 3 deletions src/Fixer/IsArrayNotEmptyFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ public function getDefinition(): FixerDefinitionInterface
if (!empty($array) && is_array($array)) {
}
'
',
),
new CodeSample(
'<?php
if (isset($array) && is_array($array)) {
}
'
',
),
]
],
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Fixer/MockMethodChainingIndentationFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ public function testFoo(): void
->method("isBar")
->willReturn(false);
}
'
',
),
]
],
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Fixer/MultiLineIfIndentationFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ public function bar(array $array): void
}
}
}
'
',
),
]
],
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Fixer/MultiLineLambdaFunctionArgumentsFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ static function ($i) {
},
$array
);
'
',
),
]
],
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Fixer/NoExpectsThisAnyFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public function testFoo(): void
->method("isBar")
->willReturn(false);
}
'
',
),
]
],
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Fixer/NoLineBreakBetweenMethodArgumentsFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ public function bar(FooService $fooService, BarService $barService, array $optio
{
}
}
'
',
),
]
],
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Fixer/NoSemicolonAfterShortEchoTagFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function getDefinition(): FixerDefinitionInterface
{
return new FixerDefinition(
'Remove the semicolon after a short echo tag `<?= $this->foo; ?>` instruction.',
[new CodeSample('<?= $this->foo; ?>\n')]
[new CodeSample('<?= $this->foo; ?>\n')],
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Fixer/SingleLineConfigureCommandFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ protected function configure(): void
->addOption("bar", null, InputOption::VALUE_NONE, "The option");
}
}
'
',
),
]
],
);
}

Expand Down
4 changes: 2 additions & 2 deletions src/Fixer/TypeHintOrderFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ public function __construct(
) {
}
}
'
',
),
]
],
);
}

Expand Down

0 comments on commit 5366b34

Please sign in to comment.