From 08a11ccb93936fe20818c9f7831cd6d389d6fd50 Mon Sep 17 00:00:00 2001 From: Daniel Rotter Date: Tue, 11 Apr 2023 19:52:20 +0200 Subject: [PATCH] Adjust current ruleset based on Symfony --- src/Config.php | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/Config.php b/src/Config.php index 269c0ef..cc1de1f 100644 --- a/src/Config.php +++ b/src/Config.php @@ -9,6 +9,7 @@ public function getRules(): array return [ '@PER' => true, 'align_multiline_comment' => true, + 'array_indentation' => true, 'array_syntax' => true, 'backtick_to_shell_exec' => true, 'binary_operator_spaces' => true, @@ -28,7 +29,7 @@ public function getRules(): array ], 'class_reference_name_casing' => true, 'clean_namespace' => true, - 'concat_space' => true, + 'concat_space' => ['spacing' => 'one'], 'curly_braces_position' => [ 'allow_single_line_anonymous_functions' => true, 'allow_single_line_empty_anonymous_classes' => true, @@ -59,6 +60,10 @@ public function getRules(): array 'method_argument_space' => [ 'on_multiline' => 'ignore', ], + 'method_chaining_indentation' => true, + 'multiline_whitespace_before_semicolons' => [ + 'strategy' => 'new_line_for_chained_calls', + ], 'native_function_casing' => true, 'native_function_type_declaration_casing' => true, 'no_alias_language_construct_call' => true, @@ -132,7 +137,9 @@ public function getRules(): array ], 'php_unit_fqcn_annotation' => true, 'php_unit_method_casing' => true, - 'phpdoc_align' => true, + 'phpdoc_align' => [ + 'align' => 'left', + ], 'phpdoc_annotation_without_dot' => true, 'phpdoc_indent' => true, 'phpdoc_inline_tag_normalizer' => true, @@ -167,6 +174,7 @@ public function getRules(): array ], 'phpdoc_var_without_name' => true, 'protected_to_private' => true, + 'return_assignment' => true, 'semicolon_after_instruction' => true, 'simple_to_complex_string_variable' => true, 'single_class_element_per_statement' => true, @@ -186,12 +194,18 @@ public function getRules(): array 'standardize_increment' => true, 'standardize_not_equals' => true, 'switch_continue_to_break' => true, - 'trailing_comma_in_multiline' => true, + 'trailing_comma_in_multiline' => [ + 'elements' => ['arguments', 'arrays', 'match', 'parameters'], + ], 'trim_array_spaces' => true, 'types_spaces' => true, 'unary_operator_spaces' => true, 'whitespace_after_comma_in_array' => true, - 'yoda_style' => true, + 'yoda_style' => [ + 'equal' => false, + 'identical' => false, + 'less_and_greater' => false, + ], ]; } }