|
6 | 6 | @license http://opensource.org/licenses/MIT MIT |
7 | 7 | EOF; |
8 | 8 |
|
9 | | -return \PhpCsFixer\Config::create() |
| 9 | +return (new \PhpCsFixer\Config()) |
10 | 10 | ->setRiskyAllowed(true) |
11 | 11 | ->setRules(array( |
12 | 12 | '@PSR2' => true, |
13 | | - 'header_comment' => ['header' => $header, 'commentType' => 'PHPDoc', 'separate' => 'none'], |
| 13 | + 'header_comment' => ['header' => $header, 'comment_type' => 'PHPDoc', 'separate' => 'none'], |
14 | 14 | 'array_syntax' => ['syntax' => 'short'], |
15 | | - 'binary_operator_spaces' => ['align_equals' => false, 'align_double_arrow' => false], |
| 15 | + 'binary_operator_spaces' => ['default' => 'single_space'], |
16 | 16 | 'blank_line_after_opening_tag' => true, |
17 | 17 | 'blank_line_after_namespace' => false, |
18 | | - 'blank_line_before_return' => true, |
| 18 | + 'blank_line_before_statement' => ['statements' => ['return']], |
19 | 19 | 'cast_spaces' => true, |
20 | 20 | // 'class_keyword_remove' => true, |
21 | 21 | 'combine_consecutive_unsets' => true, |
|
24 | 24 | 'declare_strict_types' => false, |
25 | 25 | 'dir_constant' => true, |
26 | 26 | 'ereg_to_preg' => true, |
27 | | - 'function_typehint_space' => true, |
| 27 | + 'type_declaration_spaces' => true, |
28 | 28 | 'general_phpdoc_annotation_remove' => true, |
29 | | - 'hash_to_slash_comment' => true, |
| 29 | + 'single_line_comment_style' => ['comment_types' => ['hash']], |
30 | 30 | 'heredoc_to_nowdoc' => true, |
31 | 31 | 'include' => true, |
32 | 32 | 'indentation_type' => true, |
33 | | - 'is_null' => ['use_yoda_style' => false], |
| 33 | + 'is_null' => true, |
34 | 34 | 'linebreak_after_opening_tag' => true, |
35 | 35 | 'lowercase_cast' => true, |
36 | 36 | // 'mb_str_functions' => true, |
37 | | - 'method_separation' => true, |
| 37 | + 'class_attributes_separation' => ['elements' => ['method' => 'one', 'trait_import' => 'none']], |
38 | 38 | 'modernize_types_casting' => true, |
39 | 39 | 'native_function_casing' => true, |
40 | 40 | // 'native_function_invocation' => true, |
41 | | - 'new_with_braces' => false, // |
| 41 | + 'new_with_parentheses' => false, // |
42 | 42 | 'no_alias_functions' => true, |
43 | 43 | 'no_blank_lines_after_class_opening' => true, |
44 | 44 | 'no_blank_lines_after_phpdoc' => true, |
45 | | - 'no_blank_lines_before_namespace' => true, |
| 45 | + 'blank_lines_before_namespace' => ['min_line_breaks' => 1, 'max_line_breaks' => 1], |
46 | 46 | 'no_empty_comment' => true, |
47 | 47 | 'no_empty_phpdoc' => true, |
48 | 48 | 'no_empty_statement' => true, |
49 | | - 'no_extra_consecutive_blank_lines' => ['break', 'continue', 'curly_brace_block', 'extra', 'parenthesis_brace_block', 'return', 'square_brace_block', 'throw', 'use', 'useTrait'], |
| 49 | + 'no_extra_blank_lines' => ['tokens' => ['break', 'continue', 'curly_brace_block', 'extra', 'parenthesis_brace_block', 'return', 'square_brace_block', 'throw', 'use']], |
50 | 50 | 'no_leading_import_slash' => true, |
51 | 51 | 'no_leading_namespace_whitespace' => true, |
52 | 52 | 'no_mixed_echo_print' => ['use' => 'echo'], |
53 | 53 | 'no_multiline_whitespace_around_double_arrow' => true, |
54 | | - 'no_multiline_whitespace_before_semicolons' => true, |
| 54 | + 'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'], |
55 | 55 | 'no_php4_constructor' => false, |
56 | 56 | 'no_short_bool_cast' => true, |
57 | | - 'no_short_echo_tag' => false, |
| 57 | + 'echo_tag_syntax' => false, |
58 | 58 | 'no_singleline_whitespace_before_semicolons' => true, |
59 | 59 | 'no_spaces_around_offset' => true, |
60 | | - 'no_trailing_comma_in_list_call' => true, |
61 | | - 'no_trailing_comma_in_singleline_array' => true, |
| 60 | + 'no_trailing_comma_in_singleline' => true, |
62 | 61 | 'no_trailing_whitespace' => true, |
63 | 62 | 'no_trailing_whitespace_in_comment' => true, |
64 | 63 | 'no_unneeded_control_parentheses' => true, |
|
82 | 81 | 'phpdoc_align' => true, |
83 | 82 | 'phpdoc_annotation_without_dot' => true, |
84 | 83 | 'phpdoc_indent' => true, |
85 | | - 'phpdoc_inline_tag' => true, |
| 84 | + 'phpdoc_inline_tag_normalizer' => true, |
86 | 85 | 'phpdoc_no_access' => true, |
87 | | - 'phpdoc_no_alias_tag' => ['property-read' => 'property', 'property-write' => 'property', 'type' => 'var'], |
| 86 | + 'phpdoc_no_alias_tag' => ['replacements' => ['property-read' => 'property', 'property-write' => 'property', 'type' => 'var']], |
88 | 87 | 'phpdoc_no_empty_return' => true, |
89 | 88 | 'phpdoc_no_package' => true, |
90 | 89 | // 'phpdoc_no_useless_inheritdoc' => true, |
|
101 | 100 | 'pow_to_exponentiation' => true, |
102 | 101 | // 'pre_increment' => true, |
103 | 102 | 'protected_to_private' => true, |
104 | | - 'psr0' => true, |
105 | | - 'psr4' => true, |
| 103 | + 'psr_autoloading' => true, |
106 | 104 | 'random_api_migration' => true, |
107 | 105 | 'return_type_declaration' => ['space_before' => 'one'], |
108 | 106 | 'self_accessor' => true, |
|
125 | 123 | ->setFinder( |
126 | 124 | PhpCsFixer\Finder::create() |
127 | 125 | ->exclude('tests/Fake') |
| 126 | + ->exclude('tests/tmp') |
128 | 127 | ->exclude('src-data') |
129 | 128 | ->exclude('src-deprecated') |
| 129 | + ->exclude('docs/demo/tmp') |
130 | 130 | ->in(__DIR__) |
131 | 131 | )->setLineEnding("\n") |
132 | 132 | ->setUsingCache(false); |
0 commit comments