8
8
*
9
9
* @see https://bushbaby.nl/
10
10
*
11
- * @copyright Copyright (c) 2016-2019 prooph software GmbH <[email protected] >
12
- * @copyright Copyright (c) 2016-2019 Sascha-Oliver Prolic <[email protected] >.
13
- * @copyright Copyright (c) 2010-2019 bushbaby multimedia. (https://bushbaby.nl)
11
+ * @copyright Copyright (c) 2016-2021 prooph software GmbH <[email protected] >
12
+ * @copyright Copyright (c) 2016-2021 Sascha-Oliver Prolic <[email protected] >.
13
+ * @copyright Copyright (c) 2010-2021 bushbaby multimedia. (https://bushbaby.nl)
14
14
* @author Bas Kamer <[email protected] >
15
15
* @license MIT
16
16
*
@@ -33,13 +33,9 @@ class Config extends PhpCsFixerConfig
33
33
'@PSR2 ' => true ,
34
34
'@Symfony ' => true ,
35
35
'array_syntax ' => ['syntax ' => 'short ' ],
36
- 'binary_operator_spaces ' => [
37
- 'align_double_arrow ' => false ,
38
- 'align_equals ' => false ,
39
- ],
40
- 'blank_line_after_namespace ' => true ,
36
+ 'blank_line_after_namespace ' => true ,
41
37
'blank_line_after_opening_tag ' => true ,
42
- 'blank_line_before_return ' => true ,
38
+ 'blank_line_before_statement ' => true ,
43
39
'braces ' => true ,
44
40
'cast_spaces ' => true ,
45
41
'class_definition ' => true ,
@@ -51,9 +47,9 @@ class Config extends PhpCsFixerConfig
51
47
'full_opening_tag ' => true ,
52
48
'function_declaration ' => true ,
53
49
'function_typehint_space ' => true ,
54
- 'hash_to_slash_comment ' => true ,
50
+ 'single_line_comment_style ' => true ,
55
51
'header_comment ' => [
56
- 'commentType ' => 'PHPDoc ' ,
52
+ 'comment_type ' => 'PHPDoc ' ,
57
53
'header ' => 'Bushbaby was here at `%package%` in `%year%`! Please create a .docheader in the project root and run `composer cs-fix` ' ,
58
54
'location ' => 'after_open ' ,
59
55
'separate ' => 'both ' ,
@@ -62,10 +58,10 @@ class Config extends PhpCsFixerConfig
62
58
'indentation_type ' => true ,
63
59
'line_ending ' => true ,
64
60
'linebreak_after_opening_tag ' => true ,
65
- 'lowercase_constants ' => true ,
61
+ 'constant_case ' => true ,
66
62
'lowercase_keywords ' => true ,
67
63
'method_argument_space ' => true ,
68
- 'method_separation ' => true ,
64
+ 'class_attributes_separation ' => true ,
69
65
'modernize_types_casting ' => true ,
70
66
'native_function_casing ' => true ,
71
67
'native_function_invocation ' => true ,
@@ -74,13 +70,13 @@ class Config extends PhpCsFixerConfig
74
70
'no_blank_lines_after_class_opening ' => true ,
75
71
'no_closing_tag ' => true ,
76
72
'no_empty_statement ' => true ,
77
- 'no_extra_consecutive_blank_lines ' => true ,
73
+ 'no_extra_blank_lines ' => true ,
78
74
'no_leading_import_slash ' => true ,
79
75
'no_leading_namespace_whitespace ' => true ,
80
76
'no_multiline_whitespace_around_double_arrow ' => true ,
81
- 'no_multiline_whitespace_before_semicolons ' => true ,
77
+ 'multiline_whitespace_before_semicolons ' => true ,
82
78
'no_short_bool_cast ' => true ,
83
- 'no_short_echo_tag ' => true ,
79
+ 'echo_tag_syntax ' => [ ' format ' => ' long ' ] ,
84
80
'no_singleline_whitespace_before_semicolons ' => true ,
85
81
'no_spaces_around_offset ' => true ,
86
82
'no_spaces_inside_parenthesis ' => true ,
@@ -99,8 +95,10 @@ class Config extends PhpCsFixerConfig
99
95
'object_operator_without_whitespace ' => true ,
100
96
'ordered_imports ' => true ,
101
97
'phpdoc_indent ' => true ,
102
- 'phpdoc_inline_tag ' => true ,
103
- 'psr4 ' => true ,
98
+ 'general_phpdoc_tag_rename ' => true ,
99
+ 'phpdoc_inline_tag_normalizer ' => true ,
100
+ 'phpdoc_tag_type ' => true ,
101
+ 'psr_autoloading ' => true ,
104
102
'return_type_declaration ' => true ,
105
103
'semicolon_after_instruction ' => true ,
106
104
'short_scalar_cast ' => true ,
@@ -115,7 +113,7 @@ class Config extends PhpCsFixerConfig
115
113
'switch_case_semicolon_to_colon ' => true ,
116
114
'switch_case_space ' => true ,
117
115
'ternary_operator_spaces ' => true ,
118
- 'trailing_comma_in_multiline_array ' => true ,
116
+ 'trailing_comma_in_multiline ' => [ ' elements ' => [ ' arrays ' ]] ,
119
117
'trim_array_spaces ' => true ,
120
118
'unary_operator_spaces ' => true ,
121
119
'visibility_required ' => true ,
@@ -126,7 +124,7 @@ public function __construct(array $overrides = [])
126
124
{
127
125
parent ::__construct ('bushbaby php-cs-fixer-config ' );
128
126
129
- $ this ->setRules (\ array_merge ($ this ->defaults , $ overrides ));
127
+ $ this ->setRules (array_merge ($ this ->defaults , $ overrides ));
130
128
$ this ->setRiskyAllowed (true );
131
129
}
132
130
@@ -141,23 +139,23 @@ public function getRules(): array
141
139
142
140
private function headerComment (array $ rules ): array
143
141
{
144
- if (\ file_exists ('.docheader ' )) {
145
- $ header = \ file_get_contents ('.docheader ' );
142
+ if (file_exists ('.docheader ' )) {
143
+ $ header = file_get_contents ('.docheader ' );
146
144
} else {
147
145
$ header = $ rules ['header ' ];
148
146
}
149
147
150
148
// remove comments from existing .docheader or crash
151
- $ header = \ str_replace (['/** ' , ' */ ' , ' * ' , ' * ' ], '' , $ header );
149
+ $ header = str_replace (['/** ' , ' */ ' , ' * ' , ' * ' ], '' , $ header );
152
150
$ package = 'unknown ' ;
153
151
154
- if (\ file_exists ('composer.json ' )) {
155
- $ package = \ json_decode (\ file_get_contents ('composer.json ' ))->name ?? 'unknown/unknown ' ;
152
+ if (file_exists ('composer.json ' )) {
153
+ $ package = json_decode (file_get_contents ('composer.json ' ))->name ?? 'unknown/unknown ' ;
156
154
}
157
155
158
- $ header = \ str_replace (['%package% ' , '%year% ' ], [$ package , (new \DateTime ('now ' ))->format ('Y ' )], $ header );
156
+ $ header = str_replace (['%package% ' , '%year% ' ], [$ package , (new \DateTime ('now ' ))->format ('Y ' )], $ header );
159
157
160
- $ rules ['header ' ] = \ trim ($ header );
158
+ $ rules ['header ' ] = trim ($ header );
161
159
162
160
return $ rules ;
163
161
}
0 commit comments