Skip to content

Commit 8776bb2

Browse files
committed
update rules to v3 compliance
1 parent 6d8882a commit 8776bb2

File tree

4 files changed

+31
-34
lines changed

4 files changed

+31
-34
lines changed

.php-cs-fixer.dist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
// optional: chain additiional custom Finder options:
99
$finder = ComposerPackageFinder::create(__DIR__);
1010

11-
return SharedConfig::create($finder, new DefaultRuleset());
11+
return SharedConfig::create($finder, new DefaultRuleset());

src/Rulesets/LaravelShiftRuleset.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function rules(): array
3535
'braces' => true,
3636
'cast_spaces' => true,
3737
'class_attributes_separation' => [
38-
'elements' => ['method'],
38+
'elements' => ['method' => 'one'],
3939
],
4040
'class_definition' => true,
4141
'concat_space' => [
@@ -102,7 +102,7 @@ public function rules(): array
102102
'normalize_index_brace' => true,
103103
'not_operator_with_successor_space' => true,
104104
'object_operator_without_whitespace' => true,
105-
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
105+
'ordered_imports' => ['sort_algorithm' => 'alpha'],
106106
'phpdoc_indent' => true,
107107
//'phpdoc_inline_tag' => true,
108108
'phpdoc_no_access' => true,
@@ -115,7 +115,6 @@ public function rules(): array
115115
'phpdoc_trim' => true,
116116
'phpdoc_types' => true,
117117
'phpdoc_var_without_name' => true,
118-
'psr4' => true,
119118
'self_accessor' => true,
120119
'short_scalar_cast' => true,
121120
'simplified_null_return' => false, // disabled by Shift

src/Rulesets/PhpUnitRuleset.php

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,34 +27,32 @@ public function rules(): array
2727
],
2828
],
2929
'blank_line_after_namespace' => true,
30-
'blank_line_before_statement' => [
31-
'statements' => [
32-
'break',
33-
'continue',
34-
'declare',
35-
'default',
36-
'die',
37-
'do',
38-
'exit',
39-
'for',
40-
'foreach',
41-
'goto',
42-
'if',
43-
'include',
44-
'include_once',
45-
'require',
46-
'require_once',
47-
'return',
48-
'switch',
49-
'throw',
50-
'try',
51-
'while',
52-
'yield',
30+
'blank_line_before_statement' => ['statements' => [
31+
'break',
32+
'continue',
33+
'declare',
34+
'default',
35+
'do',
36+
'exit',
37+
'for',
38+
'foreach',
39+
'goto',
40+
'if',
41+
'include',
42+
'include_once',
43+
'require',
44+
'require_once',
45+
'return',
46+
'switch',
47+
'throw',
48+
'try',
49+
'while',
50+
'yield',
5351
],
5452
],
5553
'braces' => true,
5654
'cast_spaces' => true,
57-
'class_attributes_separation' => ['elements' => ['const', 'method', 'property']],
55+
'class_attributes_separation' => ['elements' => ['const' => 'one', 'method' => 'one', 'property' => 'one']],
5856
'combine_consecutive_issets' => true,
5957
'combine_consecutive_unsets' => true,
6058
'compact_nullable_typehint' => true,
@@ -89,7 +87,7 @@ public function rules(): array
8987
'lowercase_static_reference' => true,
9088
'magic_constant_casing' => true,
9189
'magic_method_casing' => true,
92-
'method_argument_space' => ['ensure_fully_multiline' => true],
90+
// 'on_multiline' => 'ensure_fully_multiline',
9391
'modernize_types_casting' => true,
9492
'multiline_comment_opening_closing' => true,
9593
'multiline_whitespace_before_semicolons' => true,
@@ -214,7 +212,9 @@ public function rules(): array
214212
'standardize_not_equals' => true,
215213
'strict_param' => true,
216214
'ternary_to_null_coalescing' => true,
217-
'trailing_comma_in_multiline_array' => true,
215+
'trailing_comma_in_multiline' => [
216+
'elements' => ['arrays'],
217+
],
218218
'trim_array_spaces' => true,
219219
'unary_operator_spaces' => true,
220220
'visibility_required' => [

src/Rulesets/SpatieRuleset.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function rules(): array
2424
return array_merge([
2525
'@PSR2' => true,
2626
'array_syntax' => ['syntax' => 'short'],
27-
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
27+
'ordered_imports' => ['sort_algorithm' => 'alpha'],
2828
'no_unused_imports' => true,
2929
'not_operator_with_successor_space' => true,
3030
'trailing_comma_in_multiline' => [
@@ -39,9 +39,7 @@ public function rules(): array
3939
'phpdoc_single_line_var_spacing' => true,
4040
'phpdoc_var_without_name' => true,
4141
'class_attributes_separation' => [
42-
'elements' => [
43-
'method',
44-
],
42+
'elements' => ['method' => 'one'],
4543
],
4644
'method_argument_space' => [
4745
'on_multiline' => 'ensure_fully_multiline',

0 commit comments

Comments
 (0)