Commit | Line | Data |
---|---|---|
fea86294 TD |
1 | <?php |
2 | $finder = PhpCsFixer\Finder::create() | |
3 | ->exclude('*/vendor/*') | |
4 | ->in(__DIR__.'/files/'); | |
5 | ||
6 | return (new PhpCsFixer\Config()) | |
7 | ->setRiskyAllowed(true) | |
8 | ->setRules([ | |
18dddd38 | 9 | '@PER-CS2.0' => true, |
fea86294 TD |
10 | |
11 | 'array_push' => true, | |
12 | 'backtick_to_shell_exec' => true, | |
13 | 'no_alias_language_construct_call' => true, | |
14 | 'no_mixed_echo_print' => true, | |
15 | 'pow_to_exponentiation' => true, | |
16 | 'random_api_migration' => true, | |
17 | ||
18 | 'array_syntax' => ['syntax' => 'short'], | |
19 | 'no_multiline_whitespace_around_double_arrow' => true, | |
20 | 'no_trailing_comma_in_singleline_array' => true, | |
21 | 'no_whitespace_before_comma_in_array' => true, | |
22 | 'normalize_index_brace' => true, | |
fea86294 TD |
23 | 'whitespace_after_comma_in_array' => true, |
24 | ||
25 | 'non_printable_character' => ['use_escape_sequences_in_strings' => true], | |
26 | ||
fea86294 TD |
27 | 'magic_constant_casing' => true, |
28 | 'magic_method_casing' => true, | |
29 | 'native_function_casing' => true, | |
30 | 'native_function_type_declaration_casing' => true, | |
31 | ||
32 | 'cast_spaces' => ['space' => 'none'], | |
fea86294 | 33 | 'no_unset_cast' => true, |
fea86294 TD |
34 | |
35 | 'class_attributes_separation' => true, | |
fea86294 TD |
36 | 'no_null_property_initialization' => true, |
37 | 'self_accessor' => true, | |
38 | 'single_class_element_per_statement' => true, | |
fea86294 TD |
39 | |
40 | 'no_empty_comment' => true, | |
41 | 'single_line_comment_style' => ['comment_types' => ['hash']], | |
42 | ||
b01a3622 | 43 | 'native_constant_invocation' => ['strict' => false], |
fea86294 TD |
44 | |
45 | 'no_alternative_syntax' => true, | |
46 | 'no_trailing_comma_in_list_call' => true, | |
47 | 'no_unneeded_control_parentheses' => ['statements' => ['break', 'clone', 'continue', 'echo_print', 'return', 'switch_case', 'yield', 'yield_from']], | |
48 | 'no_unneeded_curly_braces' => ['namespaces' => true], | |
49 | 'switch_continue_to_break' => true, | |
b01a3622 | 50 | 'trailing_comma_in_multiline' => ['elements' => ['arrays']], |
fea86294 TD |
51 | |
52 | 'function_typehint_space' => true, | |
53 | 'lambda_not_used_import' => true, | |
b01a3622 | 54 | 'native_function_invocation' => ['include' => ['@internal']], |
fea86294 TD |
55 | 'no_unreachable_default_argument_value' => true, |
56 | 'nullable_type_declaration_for_default_null_value' => true, | |
fea86294 TD |
57 | 'static_lambda' => true, |
58 | ||
59 | 'fully_qualified_strict_types' => true, | |
fea86294 TD |
60 | 'no_unused_imports' => true, |
61 | 'ordered_imports' => true, | |
62 | ||
fea86294 TD |
63 | 'dir_constant' => true, |
64 | 'explicit_indirect_variable' => true, | |
65 | 'function_to_constant' => true, | |
66 | 'is_null' => true, | |
67 | 'no_unset_on_property' => true, | |
68 | ||
69 | 'list_syntax' => ['syntax' => 'short'], | |
70 | ||
71 | 'clean_namespace' => true, | |
72 | 'no_leading_namespace_whitespace' => true, | |
fea86294 TD |
73 | |
74 | 'no_homoglyph_names' => true, | |
75 | ||
76 | 'binary_operator_spaces' => true, | |
77 | 'concat_space' => ['spacing' => 'one'], | |
78 | 'increment_style' => ['style' => 'post'], | |
79 | 'logical_operators' => true, | |
80 | 'object_operator_without_whitespace' => true, | |
81 | 'operator_linebreak' => true, | |
82 | 'standardize_increment' => true, | |
83 | 'standardize_not_equals' => true, | |
fea86294 TD |
84 | 'ternary_to_elvis_operator' => true, |
85 | 'ternary_to_null_coalescing' => true, | |
86 | 'unary_operator_spaces' => true, | |
87 | ||
88 | 'no_useless_return' => true, | |
89 | 'return_assignment' => true, | |
fea86294 TD |
90 | |
91 | 'multiline_whitespace_before_semicolons' => true, | |
92 | 'no_empty_statement' => true, | |
93 | 'no_singleline_whitespace_before_semicolons' => true, | |
94 | 'space_after_semicolon' => ['remove_in_empty_for_expressions' => true], | |
95 | ||
96 | 'escape_implicit_backslashes' => true, | |
97 | 'explicit_string_variable' => true, | |
98 | 'heredoc_to_nowdoc' => true, | |
99 | 'no_binary_string' => true, | |
100 | 'simple_to_complex_string_variable' => true, | |
101 | ||
102 | 'array_indentation' => true, | |
103 | 'blank_line_before_statement' => ['statements' => ['return', 'exit']], | |
fea86294 | 104 | 'method_chaining_indentation' => true, |
ae225b4a | 105 | 'no_extra_blank_lines' => ['tokens' => ['case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'square_brace_block', 'switch', 'throw', 'use']], |
fea86294 TD |
106 | 'no_spaces_around_offset' => true, |
107 | ]) | |
108 | ->setFinder($finder); |