Skip to content

Commit fdcf59d

Browse files
authored
[TASK] Add more PHP-CS-Fixer rules (MyIntervals#631)
Also drop some rules that do not change the default configuration.
1 parent 8f2ba48 commit fdcf59d

File tree

1 file changed

+62
-5
lines changed

1 file changed

+62
-5
lines changed

config/php-cs-fixer.php

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,76 @@
2222
// overwrite the PER2 defaults to restore compatibility with PHP 7.x
2323
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
2424

25-
// for `in_array` & friends
26-
'strict_param' => true,
25+
// casing
26+
'magic_constant_casing' => true,
27+
'native_function_casing' => true,
28+
29+
// cast notation
30+
'modernize_types_casting' => true,
31+
'no_short_bool_cast' => true,
32+
33+
// class notation
34+
'no_php4_constructor' => true,
35+
36+
// comment
37+
'no_empty_comment' => true,
38+
39+
// control structure
40+
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
41+
42+
// function notation
43+
'native_function_invocation' => ['include' => ['@all']],
44+
45+
// import
46+
'no_unused_imports' => true,
47+
48+
// language construct
49+
'combine_consecutive_issets' => true,
50+
'combine_consecutive_unsets' => true,
51+
'dir_constant' => true,
52+
'is_null' => true,
53+
54+
// namespace notation
55+
'no_leading_namespace_whitespace' => true,
2756

57+
// operator
58+
'standardize_not_equals' => true,
59+
'ternary_to_null_coalescing' => true,
60+
61+
// PHP tag
62+
'linebreak_after_opening_tag' => true,
63+
64+
// PHPUnit
2865
'php_unit_construct' => true,
2966
'php_unit_dedicate_assert' => ['target' => 'newest'],
3067
'php_unit_expectation' => ['target' => 'newest'],
3168
'php_unit_fqcn_annotation' => true,
32-
'php_unit_method_casing' => true,
33-
'php_unit_mock' => ['target' => 'newest'],
3469
'php_unit_mock_short_will_return' => true,
35-
'php_unit_namespaced' => ['target' => 'newest'],
3670
'php_unit_set_up_tear_down_visibility' => true,
3771
'php_unit_test_annotation' => ['style' => 'annotation'],
3872
'php_unit_test_case_static_method_calls' => ['call_type' => 'self'],
73+
74+
// PHPDoc
75+
'no_blank_lines_after_phpdoc' => true,
76+
'no_empty_phpdoc' => true,
77+
'phpdoc_indent' => true,
78+
'phpdoc_no_package' => true,
79+
'phpdoc_trim' => true,
80+
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'],
81+
82+
// return notation
83+
'no_useless_return' => true,
84+
85+
// semicolon
86+
'no_empty_statement' => true,
87+
'no_singleline_whitespace_before_semicolons' => true,
88+
'semicolon_after_instruction' => true,
89+
90+
// strict
91+
// 'declare_strict_types' => true, // Note: We'll need to add some casts first.
92+
'strict_param' => true,
93+
94+
// string notation
95+
'string_implicit_backslashes' => ['single_quoted' => 'escape'],
3996
]
4097
);

0 commit comments

Comments
 (0)