|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
$config = new PhpCsFixer\Config(); |
|
|
|
|
|
|
4
|
|
|
$config->setRiskyAllowed(true) |
|
5
|
|
|
->setIndent("\t") |
|
6
|
|
|
->setCacheFile(__DIR__ . '/.php-cs-fixer.cache') |
|
7
|
|
|
->setRules([ |
|
8
|
|
|
'@PHP80Migration' => true, |
|
9
|
|
|
'@PHP80Migration:risky' => true, |
|
10
|
|
|
'@PhpCsFixer' => true, |
|
11
|
|
|
'@PhpCsFixer:risky' => true, |
|
12
|
|
|
'@PSR2' => true, |
|
13
|
|
|
'list_syntax' => ['syntax' => 'short'], |
|
14
|
|
|
'align_multiline_comment' => true, |
|
15
|
|
|
'array_syntax' => ['syntax' => 'short'], |
|
16
|
|
|
'blank_line_after_namespace' => true, |
|
17
|
|
|
'blank_line_after_opening_tag' => true, |
|
18
|
|
|
'blank_line_before_statement' => false, |
|
19
|
|
|
'binary_operator_spaces' => true, |
|
20
|
|
|
'cast_spaces' => true, |
|
21
|
|
|
'class_definition' => ['single_line' => true], |
|
22
|
|
|
'class_keyword_remove' => false, |
|
23
|
|
|
'combine_consecutive_issets' => true, |
|
24
|
|
|
'combine_consecutive_unsets' => true, |
|
25
|
|
|
'compact_nullable_typehint' => true, |
|
26
|
|
|
'concat_space' => [ |
|
27
|
|
|
'spacing' => 'one', |
|
28
|
|
|
], |
|
29
|
|
|
'explicit_string_variable' => false, |
|
30
|
|
|
'declare_equal_normalize' => true, |
|
31
|
|
|
'declare_strict_types' => false, |
|
32
|
|
|
'dir_constant' => false, |
|
33
|
|
|
'doctrine_annotation_braces' => true, |
|
34
|
|
|
'doctrine_annotation_indentation' => true, |
|
35
|
|
|
'doctrine_annotation_spaces' => true, |
|
36
|
|
|
'function_typehint_space' => true, |
|
37
|
|
|
'general_phpdoc_annotation_remove' => false, |
|
38
|
|
|
'single_line_comment_style' => ['comment_types' => ['hash']], |
|
39
|
|
|
'include' => true, |
|
40
|
|
|
'linebreak_after_opening_tag' => true, |
|
41
|
|
|
'lowercase_cast' => true, |
|
42
|
|
|
'magic_constant_casing' => true, |
|
43
|
|
|
'method_chaining_indentation' => true, |
|
44
|
|
|
'class_attributes_separation' => ['elements' => ['method' => 'one']], |
|
45
|
|
|
'method_argument_space' => true, |
|
46
|
|
|
'modernize_types_casting' => true, |
|
47
|
|
|
'multiline_comment_opening_closing' => true, |
|
48
|
|
|
'native_function_casing' => true, |
|
49
|
|
|
'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'all'], |
|
50
|
|
|
'new_with_braces' => true, |
|
51
|
|
|
'no_alias_functions' => true, |
|
52
|
|
|
'no_blank_lines_after_class_opening' => true, |
|
53
|
|
|
'no_blank_lines_after_phpdoc' => true, |
|
54
|
|
|
'no_closing_tag' => true, |
|
55
|
|
|
'no_empty_comment' => true, |
|
56
|
|
|
'no_empty_phpdoc' => true, |
|
57
|
|
|
'no_empty_statement' => true, |
|
58
|
|
|
'no_extra_blank_lines' => ['tokens' => ['break', 'continue', 'extra', 'return', 'throw', 'use', 'parenthesis_brace_block', 'square_brace_block', 'curly_brace_block']], |
|
59
|
|
|
'no_leading_import_slash' => true, |
|
60
|
|
|
'no_leading_namespace_whitespace' => true, |
|
61
|
|
|
'no_mixed_echo_print' => [ |
|
62
|
|
|
'use' => 'echo', |
|
63
|
|
|
], |
|
64
|
|
|
'no_multiline_whitespace_around_double_arrow' => true, |
|
65
|
|
|
'multiline_whitespace_before_semicolons' => true, |
|
66
|
|
|
'no_null_property_initialization' => true, |
|
67
|
|
|
'no_php4_constructor' => false, |
|
68
|
|
|
'no_short_bool_cast' => true, |
|
69
|
|
|
'echo_tag_syntax' => ['format' => 'long'], |
|
70
|
|
|
'no_superfluous_phpdoc_tags' => false, |
|
71
|
|
|
'no_singleline_whitespace_before_semicolons' => true, |
|
72
|
|
|
'no_spaces_after_function_name' => true, |
|
73
|
|
|
'no_spaces_inside_parenthesis' => true, |
|
74
|
|
|
'no_trailing_comma_in_list_call' => true, |
|
75
|
|
|
'no_trailing_comma_in_singleline_array' => true, |
|
76
|
|
|
'no_trailing_whitespace' => true, |
|
77
|
|
|
'no_trailing_whitespace_in_comment' => true, |
|
78
|
|
|
'no_unneeded_final_method' => true, |
|
79
|
|
|
'no_unused_imports' => true, |
|
80
|
|
|
'no_useless_else' => false, |
|
81
|
|
|
'no_useless_return' => true, |
|
82
|
|
|
'no_whitespace_before_comma_in_array' => true, |
|
83
|
|
|
'no_whitespace_in_blank_line' => true, |
|
84
|
|
|
'normalize_index_brace' => true, |
|
85
|
|
|
'not_operator_with_space' => false, |
|
86
|
|
|
'not_operator_with_successor_space' => false, |
|
87
|
|
|
'object_operator_without_whitespace' => true, |
|
88
|
|
|
'ordered_imports' => true, |
|
89
|
|
|
'php_unit_fqcn_annotation' => true, |
|
90
|
|
|
'phpdoc_add_missing_param_annotation' => [ |
|
91
|
|
|
'only_untyped' => false, |
|
92
|
|
|
], |
|
93
|
|
|
'phpdoc_align' => true, |
|
94
|
|
|
'phpdoc_annotation_without_dot' => false, |
|
95
|
|
|
'phpdoc_indent' => true, |
|
96
|
|
|
'general_phpdoc_tag_rename' => true, |
|
97
|
|
|
'phpdoc_inline_tag_normalizer' => true, |
|
98
|
|
|
'phpdoc_tag_type' => ['tags' => ['inheritDoc' => 'inline']], |
|
99
|
|
|
'phpdoc_no_access' => true, |
|
100
|
|
|
'phpdoc_no_empty_return' => false, |
|
101
|
|
|
'phpdoc_no_package' => false, |
|
102
|
|
|
'phpdoc_no_useless_inheritdoc' => true, |
|
103
|
|
|
'phpdoc_order' => true, |
|
104
|
|
|
'phpdoc_scalar' => true, |
|
105
|
|
|
'phpdoc_separation' => ['groups' => [['deprecated', 'link', 'see', 'since'], ['author', 'copyright', 'license'], ['category', 'package', 'subpackage'], ['property', 'property-read', 'property-write'], ['param'], ['return']], 'skip_unlisted_annotations' => true], |
|
106
|
|
|
'phpdoc_single_line_var_spacing' => true, |
|
107
|
|
|
'phpdoc_summary' => true, |
|
108
|
|
|
'phpdoc_trim' => true, |
|
109
|
|
|
'phpdoc_types' => true, |
|
110
|
|
|
'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], |
|
111
|
|
|
'phpdoc_var_without_name' => true, |
|
112
|
|
|
'psr_autoloading' => false, |
|
113
|
|
|
'return_type_declaration' => true, |
|
114
|
|
|
'self_accessor' => true, |
|
115
|
|
|
'semicolon_after_instruction' => true, |
|
116
|
|
|
'short_scalar_cast' => true, |
|
117
|
|
|
'error_suppression' => false, |
|
118
|
|
|
'single_blank_line_at_eof' => true, |
|
119
|
|
|
'single_import_per_statement' => true, |
|
120
|
|
|
'single_line_throw' => true, |
|
121
|
|
|
'single_quote' => false, |
|
122
|
|
|
'space_after_semicolon' => true, |
|
123
|
|
|
'standardize_not_equals' => true, |
|
124
|
|
|
'strict_comparison' => false, |
|
125
|
|
|
'strict_param' => false, |
|
126
|
|
|
'switch_case_semicolon_to_colon' => true, |
|
127
|
|
|
'switch_case_space' => true, |
|
128
|
|
|
'ternary_operator_spaces' => true, |
|
129
|
|
|
'ternary_to_null_coalescing' => true, |
|
130
|
|
|
'trailing_comma_in_multiline' => ['after_heredoc' => false, 'elements' => []], |
|
131
|
|
|
'trim_array_spaces' => true, |
|
132
|
|
|
'unary_operator_spaces' => true, |
|
133
|
|
|
'visibility_required' => ['elements' => ['property', 'method']], |
|
134
|
|
|
'void_return' => false, |
|
135
|
|
|
'whitespace_after_comma_in_array' => true, |
|
136
|
|
|
]) |
|
137
|
|
|
->setFinder( |
|
138
|
|
|
PhpCsFixer\Finder::create() |
|
|
|
|
|
|
139
|
|
|
->exclude('vendor') |
|
140
|
|
|
->in(__DIR__) |
|
141
|
|
|
); |
|
142
|
|
|
|
|
143
|
|
|
return $config; |
|
144
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths