diff --git a/config/ecs.php b/config/ecs.php index 82230eb..7eee687 100644 --- a/config/ecs.php +++ b/config/ecs.php @@ -14,4 +14,7 @@ $containerConfigurator->import(ECSSetList::PHP_CS_FIXER_CUSTOM); $containerConfigurator->import(ECSSetList::PHP_CODESNIFFER_CUSTOM); $containerConfigurator->import(ECSSetList::SLEVOMAT_CODING_STANDARD_CUSTOM); + + $services = $containerConfigurator->services(); + $services->remove(\Symplify\CodingStandard\Fixer\Spacing\StandaloneLineConstructorParamFixer::class); }; diff --git a/config/set/php-cs-fixer-custom.php b/config/set/php-cs-fixer-custom.php index c559b46..7ee6e7b 100644 --- a/config/set/php-cs-fixer-custom.php +++ b/config/set/php-cs-fixer-custom.php @@ -142,6 +142,7 @@ $services->set(\PhpCsFixer\Fixer\LanguageConstruct\CombineConsecutiveIssetsFixer::class); $services->set(\PhpCsFixer\Fixer\FunctionNotation\LambdaNotUsedImportFixer::class); $services->set(\PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer::class); + $services->set(\PhpCsFixer\Fixer\FunctionNotation\NoTrailingCommaInSinglelineFunctionCallFixer::class); $services->set(\PhpCsFixer\Fixer\Alias\BacktickToShellExecFixer::class); $services->set(\PhpCsFixer\Fixer\Comment\NoEmptyCommentFixer::class); $services->set(\PhpCsFixer\Fixer\Semicolon\SemicolonAfterInstructionFixer::class); @@ -151,6 +152,7 @@ $services->set(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); $services->set(\PhpCsFixer\Fixer\ControlStructure\EmptyLoopConditionFixer::class); $services->set(\PhpCsFixer\Fixer\Import\NoUnneededImportAliasFixer::class); + $services->set(\PhpCsFixer\Fixer\Comment\SingleLineCommentSpacingFixer::class); $services->set(\PhpCsFixer\Fixer\Operator\StandardizeIncrementFixer::class); $services->set(\PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class); $services->set(\PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer::class); @@ -350,6 +352,7 @@ 'switch', 'throw', 'try', + 'yield', ], ], ]); diff --git a/config/set/php-cs-fixer/php-cs-fixer.php b/config/set/php-cs-fixer/php-cs-fixer.php index 6a4d163..e0311e0 100644 --- a/config/set/php-cs-fixer/php-cs-fixer.php +++ b/config/set/php-cs-fixer/php-cs-fixer.php @@ -107,6 +107,7 @@ $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoEmptyReturnFixer::class); $services->set(\PhpCsFixer\Fixer\FunctionNotation\LambdaNotUsedImportFixer::class); $services->set(\PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer::class); + $services->set(\PhpCsFixer\Fixer\FunctionNotation\NoTrailingCommaInSinglelineFunctionCallFixer::class); $services->set(\PhpCsFixer\Fixer\LanguageConstruct\CombineConsecutiveIssetsFixer::class); $services->set(\PhpCsFixer\Fixer\Alias\BacktickToShellExecFixer::class); $services->set(\PhpCsFixer\Fixer\Comment\NoEmptyCommentFixer::class); @@ -116,6 +117,7 @@ $services->set(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); $services->set(\PhpCsFixer\Fixer\ControlStructure\EmptyLoopConditionFixer::class); $services->set(\PhpCsFixer\Fixer\Import\NoUnneededImportAliasFixer::class); + $services->set(\PhpCsFixer\Fixer\Comment\SingleLineCommentSpacingFixer::class); $services->set(\PhpCsFixer\Fixer\Operator\StandardizeIncrementFixer::class); $services->set(\PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class); $services->set(\PhpCsFixer\Fixer\Import\SingleImportPerStatementFixer::class); @@ -266,6 +268,7 @@ 'switch', 'throw', 'try', + 'yield', ], ], ]); diff --git a/config/set/php-cs-fixer/psr12.php b/config/set/php-cs-fixer/psr12.php index 8780a76..f886e94 100644 --- a/config/set/php-cs-fixer/psr12.php +++ b/config/set/php-cs-fixer/psr12.php @@ -27,6 +27,7 @@ $services->set(\PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer::class) ->call('configure', [ [ + 'inline_constructor_arguments' => false, 'space_before_parenthesis' => true, ], ]); diff --git a/config/set/php-cs-fixer/symfony.php b/config/set/php-cs-fixer/symfony.php index 1fda15f..573aff4 100644 --- a/config/set/php-cs-fixer/symfony.php +++ b/config/set/php-cs-fixer/symfony.php @@ -109,6 +109,7 @@ $services->set(\PhpCsFixer\Fixer\Phpdoc\PhpdocNoUselessInheritdocFixer::class); $services->set(\PhpCsFixer\Fixer\FunctionNotation\LambdaNotUsedImportFixer::class); $services->set(\PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer::class); + $services->set(\PhpCsFixer\Fixer\FunctionNotation\NoTrailingCommaInSinglelineFunctionCallFixer::class); $services->set(\PhpCsFixer\Fixer\FunctionNotation\NoSpacesAfterFunctionNameFixer::class); $services->set(\PhpCsFixer\Fixer\Whitespace\NoSpacesInsideParenthesisFixer::class); $services->set(\PhpCsFixer\Fixer\Alias\BacktickToShellExecFixer::class); @@ -119,6 +120,7 @@ $services->set(\PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class); $services->set(\PhpCsFixer\Fixer\ControlStructure\EmptyLoopConditionFixer::class); $services->set(\PhpCsFixer\Fixer\Import\NoUnneededImportAliasFixer::class); + $services->set(\PhpCsFixer\Fixer\Comment\SingleLineCommentSpacingFixer::class); $services->set(\PhpCsFixer\Fixer\Operator\StandardizeIncrementFixer::class); $services->set(\PhpCsFixer\Fixer\Whitespace\CompactNullableTypehintFixer::class); $services->set(\PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer::class); diff --git a/src/PhpCsFixerRuleSetGenerator.php b/src/PhpCsFixerRuleSetGenerator.php index 5ab05d6..e387a0f 100644 --- a/src/PhpCsFixerRuleSetGenerator.php +++ b/src/PhpCsFixerRuleSetGenerator.php @@ -105,7 +105,9 @@ public function formatRulesToServices( private function getSetDefinitions(): iterable { yield from RuleSets::getSetDefinitions(); + yield $this->getLaravelRuleSet(); + yield new CustomSet(); }