From b68755b0daa68ee6c4cf003d2f9f2253f2682141 Mon Sep 17 00:00:00 2001 From: zingimmick Date: Sun, 21 Aug 2022 19:51:03 +0800 Subject: [PATCH] Add extracted fixers from BracesFixer --- config/set/php-cs-fixer-custom.php | 4 ++++ src/CustomSet.php | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/config/set/php-cs-fixer-custom.php b/config/set/php-cs-fixer-custom.php index 2ce5624..d588465 100644 --- a/config/set/php-cs-fixer-custom.php +++ b/config/set/php-cs-fixer-custom.php @@ -33,6 +33,7 @@ $ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\EmptyLoopBodyFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\NoSuperfluousElseifFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\NoUselessElseFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\Basic\NoMultipleStatementsPerLineFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Strict\StrictComparisonFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\Operator\NewWithBracesFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\FunctionNotation\ImplodeCallFixer::class); @@ -202,6 +203,7 @@ $ecsConfig->rule(\PhpCsFixer\Fixer\Operator\TernaryToElvisOperatorFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\FunctionNotation\NullableTypeDeclarationForDefaultNullValueFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\SimplifiedIfReturnFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\ControlStructureBracesFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\LanguageConstruct\ExplicitIndirectVariableFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\StringNotation\ExplicitStringVariableFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\StringNotation\HeredocToNowdocFixer::class); @@ -299,6 +301,8 @@ $ecsConfig->rule(\PhpCsFixer\Fixer\StringNotation\NoTrailingWhitespaceInStringFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\ControlStructure\ControlStructureContinuationPositionFixer::class); $ecsConfig->rule(\PhpCsFixer\Fixer\LanguageConstruct\DeclareParenthesesFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\Whitespace\StatementIndentationFixer::class); + $ecsConfig->rule(\PhpCsFixer\Fixer\Basic\CurlyBracesPositionFixer::class); $ecsConfig->ruleWithConfiguration(\PhpCsFixer\Fixer\Semicolon\SpaceAfterSemicolonFixer::class, [ 'remove_in_empty_for_expressions' => true, ]); diff --git a/src/CustomSet.php b/src/CustomSet.php index 8620cac..97e737a 100644 --- a/src/CustomSet.php +++ b/src/CustomSet.php @@ -64,6 +64,10 @@ public function getRules(): array 'fopen_flags' => [ 'b_mode' => true, ], + 'statement_indentation' => true, + 'no_multiple_statements_per_line' => true, + 'curly_braces_position' => true, + 'control_structure_braces' => true, ]; } }