From 5366b34fdc3dcf4b0c85f41dc494d9433a339179 Mon Sep 17 00:00:00 2001 From: Leo Feyer <1192057+leofeyer@users.noreply.github.com> Date: Fri, 25 Aug 2023 09:50:00 +0200 Subject: [PATCH] Enable the TrailingCommaInMultilineFixer for arguments --- config/contao.php | 2 +- src/Fixer/AssertEqualsFixer.php | 4 ++-- src/Fixer/CaseCommentIndentationFixer.php | 4 ++-- src/Fixer/ExpectsWithCallbackFixer.php | 6 +++--- src/Fixer/InlinePhpdocCommentFixer.php | 4 ++-- src/Fixer/IsArrayNotEmptyFixer.php | 6 +++--- src/Fixer/MockMethodChainingIndentationFixer.php | 4 ++-- src/Fixer/MultiLineIfIndentationFixer.php | 4 ++-- src/Fixer/MultiLineLambdaFunctionArgumentsFixer.php | 4 ++-- src/Fixer/NoExpectsThisAnyFixer.php | 4 ++-- src/Fixer/NoLineBreakBetweenMethodArgumentsFixer.php | 4 ++-- src/Fixer/NoSemicolonAfterShortEchoTagFixer.php | 2 +- src/Fixer/SingleLineConfigureCommandFixer.php | 4 ++-- src/Fixer/TypeHintOrderFixer.php | 4 ++-- 14 files changed, 28 insertions(+), 28 deletions(-) diff --git a/config/contao.php b/config/contao.php index a97e502..a05672e 100644 --- a/config/contao.php +++ b/config/contao.php @@ -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]); diff --git a/src/Fixer/AssertEqualsFixer.php b/src/Fixer/AssertEqualsFixer.php index 49a9508..54a7923 100644 --- a/src/Fixer/AssertEqualsFixer.php +++ b/src/Fixer/AssertEqualsFixer.php @@ -42,9 +42,9 @@ public function testFoo(): void $this->assertSame("foo", $obj->getName()); $this->assertEquals(new Foo(), $obj); } -' +', ), - ] + ], ); } diff --git a/src/Fixer/CaseCommentIndentationFixer.php b/src/Fixer/CaseCommentIndentationFixer.php index 0f25bae..7f52b46 100644 --- a/src/Fixer/CaseCommentIndentationFixer.php +++ b/src/Fixer/CaseCommentIndentationFixer.php @@ -45,9 +45,9 @@ public function getDefinition(): FixerDefinitionInterface case 2: break; } -' +', ), - ] + ], ); } diff --git a/src/Fixer/ExpectsWithCallbackFixer.php b/src/Fixer/ExpectsWithCallbackFixer.php index 1bea39b..ebb915a 100644 --- a/src/Fixer/ExpectsWithCallbackFixer.php +++ b/src/Fixer/ExpectsWithCallbackFixer.php @@ -42,7 +42,7 @@ function () { } )); } -' +', ), new CodeSample( 'get(); } -' +', ), - ] + ], ); } diff --git a/src/Fixer/IsArrayNotEmptyFixer.php b/src/Fixer/IsArrayNotEmptyFixer.php index 457eb51..623bafb 100644 --- a/src/Fixer/IsArrayNotEmptyFixer.php +++ b/src/Fixer/IsArrayNotEmptyFixer.php @@ -30,16 +30,16 @@ public function getDefinition(): FixerDefinitionInterface if (!empty($array) && is_array($array)) { } -' +', ), new CodeSample( 'method("isBar") ->willReturn(false); } -' +', ), - ] + ], ); } diff --git a/src/Fixer/MultiLineIfIndentationFixer.php b/src/Fixer/MultiLineIfIndentationFixer.php index 43d9cd6..3992f39 100644 --- a/src/Fixer/MultiLineIfIndentationFixer.php +++ b/src/Fixer/MultiLineIfIndentationFixer.php @@ -43,9 +43,9 @@ public function bar(array $array): void } } } -' +', ), - ] + ], ); } diff --git a/src/Fixer/MultiLineLambdaFunctionArgumentsFixer.php b/src/Fixer/MultiLineLambdaFunctionArgumentsFixer.php index 71c6555..a4f2406 100644 --- a/src/Fixer/MultiLineLambdaFunctionArgumentsFixer.php +++ b/src/Fixer/MultiLineLambdaFunctionArgumentsFixer.php @@ -38,9 +38,9 @@ static function ($i) { }, $array ); -' +', ), - ] + ], ); } diff --git a/src/Fixer/NoExpectsThisAnyFixer.php b/src/Fixer/NoExpectsThisAnyFixer.php index 3517d92..4a00404 100644 --- a/src/Fixer/NoExpectsThisAnyFixer.php +++ b/src/Fixer/NoExpectsThisAnyFixer.php @@ -40,9 +40,9 @@ public function testFoo(): void ->method("isBar") ->willReturn(false); } -' +', ), - ] + ], ); } diff --git a/src/Fixer/NoLineBreakBetweenMethodArgumentsFixer.php b/src/Fixer/NoLineBreakBetweenMethodArgumentsFixer.php index 466700d..e323666 100644 --- a/src/Fixer/NoLineBreakBetweenMethodArgumentsFixer.php +++ b/src/Fixer/NoLineBreakBetweenMethodArgumentsFixer.php @@ -44,9 +44,9 @@ public function bar(FooService $fooService, BarService $barService, array $optio { } } -' +', ), - ] + ], ); } diff --git a/src/Fixer/NoSemicolonAfterShortEchoTagFixer.php b/src/Fixer/NoSemicolonAfterShortEchoTagFixer.php index 8942c4a..053676a 100644 --- a/src/Fixer/NoSemicolonAfterShortEchoTagFixer.php +++ b/src/Fixer/NoSemicolonAfterShortEchoTagFixer.php @@ -24,7 +24,7 @@ public function getDefinition(): FixerDefinitionInterface { return new FixerDefinition( 'Remove the semicolon after a short echo tag `foo; ?>` instruction.', - [new CodeSample('foo; ?>\n')] + [new CodeSample('foo; ?>\n')], ); } diff --git a/src/Fixer/SingleLineConfigureCommandFixer.php b/src/Fixer/SingleLineConfigureCommandFixer.php index f28feef..daf7b8e 100644 --- a/src/Fixer/SingleLineConfigureCommandFixer.php +++ b/src/Fixer/SingleLineConfigureCommandFixer.php @@ -42,9 +42,9 @@ protected function configure(): void ->addOption("bar", null, InputOption::VALUE_NONE, "The option"); } } -' +', ), - ] + ], ); } diff --git a/src/Fixer/TypeHintOrderFixer.php b/src/Fixer/TypeHintOrderFixer.php index 0891d33..e7133bf 100644 --- a/src/Fixer/TypeHintOrderFixer.php +++ b/src/Fixer/TypeHintOrderFixer.php @@ -52,9 +52,9 @@ public function __construct( ) { } } -' +', ), - ] + ], ); }