Skip to content

Commit c92d1fc

Browse files
committed
more phpcs rules
1 parent e1cba3a commit c92d1fc

File tree

1 file changed

+89
-9
lines changed

1 file changed

+89
-9
lines changed

.php_cs.dist.php

Lines changed: 89 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,103 @@
1313
return (new PhpCsFixer\Config())
1414
->setRules([
1515
'@PSR2' => true,
16+
'@PSR12' => true,
17+
'array_indentation' => true,
1618
'array_syntax' => ['syntax' => 'short'],
17-
'ordered_imports' => ['sort_algorithm' => 'alpha'],
18-
'no_unused_imports' => true,
19-
'not_operator_with_successor_space' => true,
20-
'trailing_comma_in_multiline' => true,
21-
'phpdoc_scalar' => true,
22-
'unary_operator_spaces' => true,
23-
'binary_operator_spaces' => true,
19+
'binary_operator_spaces' => [
20+
'default' => 'single_space',
21+
'operators' => ['=>' => 'single_space']
22+
],
2423
'blank_line_before_statement' => [
2524
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
2625
],
27-
'phpdoc_single_line_var_spacing' => true,
28-
'phpdoc_var_without_name' => true,
26+
'cast_spaces' => true,
27+
'class_attributes_separation' => [
28+
'elements' => ['method']
29+
],
30+
'concat_space' => [
31+
'spacing' => 'none'
32+
],
33+
'encoding' => true,
34+
'full_opening_tag' => true,
35+
'fully_qualified_strict_types' => true, // added by Shift
36+
'function_typehint_space' => true,
37+
'heredoc_to_nowdoc' => true,
38+
'include' => true,
39+
'increment_style' => ['style' => 'post'],
40+
'linebreak_after_opening_tag' => true,
41+
'lowercase_constants' => true,
42+
'magic_method_casing' => true, // added from Symfony
43+
'magic_constant_casing' => true,
2944
'method_argument_space' => [
3045
'on_multiline' => 'ensure_fully_multiline',
3146
'keep_multiple_spaces_after_comma' => true,
3247
],
48+
'native_function_casing' => true,
49+
'no_alias_functions' => true,
50+
'no_extra_blank_lines' => [
51+
'tokens' => [
52+
'extra',
53+
'throw',
54+
'use',
55+
'use_trait',
56+
]
57+
],
58+
'no_blank_lines_after_phpdoc' => true,
59+
'no_closing_tag' => true,
60+
'no_empty_phpdoc' => true,
61+
'no_empty_statement' => true,
62+
'no_leading_namespace_whitespace' => true,
63+
'no_mixed_echo_print' => [
64+
'use' => 'echo'
65+
],
66+
'no_multiline_whitespace_around_double_arrow' => true,
67+
'multiline_whitespace_before_semicolons' => [
68+
'strategy' => 'no_multi_line'
69+
],
70+
'no_short_bool_cast' => true,
71+
'no_singleline_whitespace_before_semicolons' => true,
72+
'no_spaces_around_offset' => true,
73+
'no_superfluous_phpdoc_tags' => true,
74+
'no_trailing_comma_in_list_call' => true,
75+
'no_trailing_comma_in_singleline_array' => true,
76+
'no_unneeded_control_parentheses' => true,
77+
'no_unreachable_default_argument_value' => true,
78+
'no_unused_imports' => true,
79+
'no_useless_return' => true,
80+
'no_whitespace_before_comma_in_array' => true,
81+
'normalize_index_brace' => true,
82+
'not_operator_with_successor_space' => true,
83+
'nullable_type_declaration_for_default_null_value' => true,
84+
'object_operator_without_whitespace' => true,
85+
'ordered_imports' => ['sort_algorithm' => 'alpha'],
86+
'phpdoc_indent' => true,
87+
'phpdoc_inline_tag' => true,
88+
'phpdoc_no_access' => true,
89+
'phpdoc_no_package' => true,
90+
'phpdoc_no_useless_inheritdoc' => true,
91+
'phpdoc_scalar' => true,
92+
'phpdoc_single_line_var_spacing' => true,
93+
'phpdoc_summary' => true,
94+
'phpdoc_to_comment' => true,
95+
'phpdoc_trim' => true,
96+
'phpdoc_types' => true,
97+
'phpdoc_var_without_name' => true,
98+
'psr4' => true,
99+
'self_accessor' => true,
100+
'simplified_null_return' => false, // disabled by Shift
101+
'single_line_comment_style' => [
102+
'comment_types' => ['hash']
103+
],
104+
'single_quote' => true,
33105
'single_trait_insert_per_statement' => true,
106+
'space_after_semicolon' => true,
107+
'standardize_not_equals' => true,
108+
'ternary_to_null_coalescing' => true,
109+
'trailing_comma_in_multiline' => true,
110+
'trim_array_spaces' => true,
111+
'unary_operator_spaces' => true,
112+
'use_arrow_functions' => true,
113+
'whitespace_after_comma_in_array' => true,
34114
])
35115
->setFinder($finder);

0 commit comments

Comments
 (0)