44
55use PhpCsFixer \Config ;
66use PhpCsFixer \Finder ;
7- use PhpCsFixerCustomFixers \Fixer \ConstructorEmptyBracesFixer ;
8- use PhpCsFixerCustomFixers \Fixer \DeclareAfterOpeningTagFixer ;
9- use PhpCsFixerCustomFixers \Fixers ;
7+ use PhpCsFixerCustomFixers ;
108
119/**
1210 * Create a php-cs-fixer config that is enhanced with MLL rules.
@@ -19,6 +17,7 @@ function config(Finder $finder, array $ruleOverrides = []): Config
1917 '@Symfony ' => true ,
2018
2119 'array_indentation ' => true ,
20+ 'assign_null_coalescing_to_coalesce_equal ' => true ,
2221 'binary_operator_spaces ' => [
2322 'default ' => 'single_space ' ,
2423 'operators ' => [],
@@ -36,9 +35,11 @@ function config(Finder $finder, array $ruleOverrides = []): Config
3635 'explicit_string_variable ' => true ,
3736 'fully_qualified_strict_types ' => false , // Messes up global config files where fully qualified class names are preferred
3837 'heredoc_indentation ' => false ,
38+ 'list_syntax ' => true ,
3939 'method_argument_space ' => [
4040 'on_multiline ' => 'ensure_fully_multiline ' ,
4141 ],
42+ 'method_chaining_indentation ' => true ,
4243 'multiline_whitespace_before_semicolons ' => [
4344 'strategy ' => 'no_multi_line ' ,
4445 ],
@@ -68,13 +69,16 @@ function config(Finder $finder, array $ruleOverrides = []): Config
6869 'phpdoc_order ' => true ,
6970 'phpdoc_to_comment ' => false , // Intermediary PHPDocs are sometimes useful to provide type assertions for PHPStan
7071 'single_line_empty_body ' => true ,
71- 'single_line_throw ' => false ,
72+ 'single_line_throw ' => true ,
7273 // TODO add trailing commas everywhere when dropping PHP 7.4
7374 'trailing_comma_in_multiline ' => [
7475 'after_heredoc ' => true ,
7576 'elements ' => [
77+ // 'arguments',
7678 'array_destructuring ' ,
7779 'arrays ' ,
80+ // 'match',
81+ // 'parameters',
7882 ],
7983 ],
8084 'yoda_style ' => [ // Not necessary with static analysis, non-Yoda is more natural to write and read
@@ -83,12 +87,13 @@ function config(Finder $finder, array $ruleOverrides = []): Config
8387 'less_and_greater ' => false ,
8488 ],
8589
86- ConstructorEmptyBracesFixer::name () => true ,
87- DeclareAfterOpeningTagFixer::name () => true , // Use native rule when added with https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/2062
90+ PhpCsFixerCustomFixers \Fixer \ConstructorEmptyBracesFixer::name () => true ,
91+ PhpCsFixerCustomFixers \Fixer \DeclareAfterOpeningTagFixer::name () => true , // Use native rule when added with https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues/2062
92+ PhpCsFixerCustomFixers \Fixer \MultilinePromotedPropertiesFixer::name () => true ,
8893 ];
8994
9095 return (new Config ())
91- ->registerCustomFixers (new Fixers ())
96+ ->registerCustomFixers (new PhpCsFixerCustomFixers \ Fixers ())
9297 ->setFinder ($ finder )
9398 ->setRules (array_merge ($ safeRules , $ ruleOverrides ));
9499}
0 commit comments