Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit a5a72a0

Browse files
committed
upgrade to v 2.4 for php-cs-fixer added new rules
1 parent 7a13ef2 commit a5a72a0

File tree

4 files changed

+80
-131
lines changed

4 files changed

+80
-131
lines changed

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
],
2626
"require": {
2727
"php" : "^7.1",
28-
"friendsofphp/php-cs-fixer" : "^2.3.2"
28+
"friendsofphp/php-cs-fixer" : "~2.4"
2929
},
3030
"require-dev": {
3131
"phpunit/phpunit" : "^6.1",
@@ -44,6 +44,9 @@
4444
"config": {
4545
"sort-packages": true
4646
},
47+
"scripts": {
48+
"cs": "sh vendor/bin/php-cs-fixer fix"
49+
},
4750
"minimum-stability" : "dev",
4851
"prefer-stable" : true
4952
}

composer.lock

Lines changed: 17 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Config.php

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
class Config extends CsConfig
88
{
99
/**
10-
* @var string|null
10+
* @var null|string
1111
*/
1212
private $header;
1313

@@ -29,41 +29,46 @@ public function __construct(string $name = 'narrowspark')
2929
public function getRules(): array
3030
{
3131
$rules = [
32-
'@PSR2' => true,
33-
'array_syntax' => [
32+
'@PSR2' => true,
33+
'@PHP71Migration:risky' => true,
34+
'array_syntax' => [
3435
'syntax' => 'short',
3536
],
3637
'binary_operator_spaces' => [
3738
'align_double_arrow' => true,
3839
'align_equals' => true,
3940
],
4041
'blank_line_after_opening_tag' => false,
41-
'blank_line_before_return' => true,
42+
'blank_line_before_statement' => true,
4243
'cast_spaces' => true,
4344
'class_keyword_remove' => false,
4445
'combine_consecutive_unsets' => true,
4546
'concat_space' => [
4647
'spacing' => 'one',
4748
],
48-
'declare_equal_normalize' => true,
49-
'declare_strict_types' => true,
50-
'dir_constant' => true,
51-
'doctrine_annotation_braces' => true,
52-
'doctrine_annotation_indentation' => true,
53-
'doctrine_annotation_spaces' => true,
54-
'ereg_to_preg' => false,
55-
'function_to_constant' => true,
56-
'function_typehint_space' => true,
57-
'general_phpdoc_annotation_remove' => false,
58-
'hash_to_slash_comment' => true,
59-
'header_comment' => false,
60-
'heredoc_to_nowdoc' => true,
61-
'include' => true,
62-
'is_null' => true,
63-
'linebreak_after_opening_tag' => true,
64-
'list_syntax' => [
49+
'declare_equal_normalize' => true,
50+
'declare_strict_types' => true,
51+
'dir_constant' => true,
52+
'doctrine_annotation_braces' => true,
53+
'doctrine_annotation_array_assignment' => true,
54+
'doctrine_annotation_indentation' => true,
55+
'doctrine_annotation_spaces' => true,
56+
'ereg_to_preg' => false,
57+
'function_to_constant' => true,
58+
'function_typehint_space' => true,
59+
'general_phpdoc_annotation_remove' => false,
60+
'header_comment' => false,
61+
'heredoc_to_nowdoc' => true,
62+
'include' => true,
63+
'is_null' => true,
64+
'linebreak_after_opening_tag' => true,
65+
'list_syntax' => [
6566
'syntax' => 'short',
6667
],
68+
'method_argument_space' => [
69+
'ensure_fully_multiline' => true,
70+
'keep_multiple_spaces_after_comma' => false,
71+
],
6772
'lowercase_cast' => true,
6873
'mb_str_functions' => true,
6974
'magic_constant_casing' => true,
@@ -91,6 +96,7 @@ public function getRules(): array
9196
'use',
9297
'useTrait',
9398
],
99+
'no_null_property_initialization' => true,
94100
'no_leading_import_slash' => true,
95101
'no_leading_namespace_whitespace' => true,
96102
'no_mixed_echo_print' => [
@@ -112,7 +118,6 @@ public function getRules(): array
112118
'no_useless_return' => true,
113119
'no_whitespace_before_comma_in_array' => true,
114120
'no_whitespace_in_blank_line' => true,
115-
'non_printable_character' => true,
116121
'normalize_index_brace' => true,
117122
'not_operator_with_space' => false,
118123
'not_operator_with_successor_space' => true,
@@ -127,19 +132,20 @@ public function getRules(): array
127132
'phpdoc_add_missing_param_annotation' => [
128133
'only_untyped' => false,
129134
],
130-
'phpdoc_align' => true,
131-
'phpdoc_annotation_without_dot' => true,
132-
'phpdoc_indent' => true,
133-
'phpdoc_inline_tag' => true,
134-
'phpdoc_no_access' => true,
135-
'phpdoc_no_alias_tag' => [
135+
'phpdoc_align' => true,
136+
'phpdoc_annotation_without_dot' => true,
137+
'phpdoc_indent' => true,
138+
'phpdoc_inline_tag' => true,
139+
'phpdoc_no_access' => true,
140+
'phpdoc_no_alias_tag' => [
136141
'type' => 'var',
137142
],
138143
'phpdoc_no_empty_return' => false,
139144
'phpdoc_no_package' => true,
140145
'phpdoc_no_useless_inheritdoc' => true,
141146
'phpdoc_return_self_reference' => true,
142147
'phpdoc_order' => true,
148+
'phpdoc_types_order' => true,
143149
'phpdoc_scalar' => true,
144150
'phpdoc_separation' => true,
145151
'phpdoc_single_line_var_spacing' => true,
@@ -148,15 +154,14 @@ public function getRules(): array
148154
'phpdoc_trim' => true,
149155
'phpdoc_types' => true,
150156
'phpdoc_var_without_name' => true,
151-
'pow_to_exponentiation' => true,
152157
'pre_increment' => true,
153158
'protected_to_private' => true,
154159
'psr0' => false,
155160
'psr4' => true,
156-
'random_api_migration' => true,
157161
'return_type_declaration' => true,
158162
'self_accessor' => false, // it causes an edge case error
159163
'semicolon_after_instruction' => true,
164+
'single_line_comment_style' => true,
160165
'short_scalar_cast' => true,
161166
'silenced_deprecation_error' => false,
162167
'simplified_null_return' => false,
@@ -171,11 +176,6 @@ public function getRules(): array
171176
'trailing_comma_in_multiline_array' => true,
172177
'trim_array_spaces' => true,
173178
'unary_operator_spaces' => true,
174-
'visibility_required' => [
175-
'const',
176-
'property',
177-
'method',
178-
],
179179
'whitespace_after_comma_in_array' => true,
180180
];
181181

0 commit comments

Comments
 (0)