Merge branch 'master' of https://github.com/WoltLab/WCF
[GitHub/WoltLab/WCF.git] / .php_cs.dist
CommitLineData
a9229942
TD
1<?php
2$finder = PhpCsFixer\Finder::create()
3 ->in(__DIR__.'/wcfsetup/')
4 ->notPath('lib/system/api')
5 ->notPath('test.php')
6 ->notPath('install.php')
7 ->notPath('core.functions.php');
8
9return (new PhpCsFixer\Config())
10 ->setRiskyAllowed(true)
11 ->setRules([
12 '@PSR1' => true,
13 '@PSR2' => true,
14
15 'array_push' => true,
16 'backtick_to_shell_exec' => true,
17 'no_alias_language_construct_call' => true,
18 'no_mixed_echo_print' => true,
19 'pow_to_exponentiation' => true,
20 'random_api_migration' => true,
21
22 'array_syntax' => ['syntax' => 'short'],
23 'no_multiline_whitespace_around_double_arrow' => true,
24 'no_trailing_comma_in_singleline_array' => true,
25 'no_whitespace_before_comma_in_array' => true,
26 'normalize_index_brace' => true,
27 'trailing_comma_in_multiline_array' => true,
28 'whitespace_after_comma_in_array' => true,
29
30 'non_printable_character' => ['use_escape_sequences_in_strings' => true],
31
32 'lowercase_static_reference' => true,
33 'magic_constant_casing' => true,
34 'magic_method_casing' => true,
35 'native_function_casing' => true,
36 'native_function_type_declaration_casing' => true,
37
38 'cast_spaces' => ['space' => 'none'],
39 'lowercase_cast' => true,
40 'no_unset_cast' => true,
41 'short_scalar_cast' => true,
42
43 'class_attributes_separation' => true,
44 'no_blank_lines_after_class_opening' => true,
45 'no_null_property_initialization' => true,
46 'self_accessor' => true,
47 'single_class_element_per_statement' => true,
48 'single_trait_insert_per_statement' => true,
49
50 'no_empty_comment' => true,
51 'single_line_comment_style' => ['comment_types' => ['hash']],
52
53 'native_constant_invocation' => true,
54
55 'no_alternative_syntax' => true,
56 'no_trailing_comma_in_list_call' => true,
57 'no_unneeded_control_parentheses' => ['statements' => ['break', 'clone', 'continue', 'echo_print', 'return', 'switch_case', 'yield', 'yield_from']],
58 'no_unneeded_curly_braces' => ['namespaces' => true],
59 'switch_continue_to_break' => true,
60
61 'function_typehint_space' => true,
62 'lambda_not_used_import' => true,
63 'native_function_invocation' => true,
64 'no_unreachable_default_argument_value' => true,
65 'nullable_type_declaration_for_default_null_value' => true,
66 'return_type_declaration' => true,
67 'static_lambda' => true,
68
69 'fully_qualified_strict_types' => true,
70 'no_leading_import_slash' => true,
71 'no_unused_imports' => true,
72 'ordered_imports' => true,
73
74 'declare_equal_normalize' => true,
75 'dir_constant' => true,
76 'explicit_indirect_variable' => true,
77 'function_to_constant' => true,
78 'is_null' => true,
79 'no_unset_on_property' => true,
80
81 'list_syntax' => ['syntax' => 'short'],
82
83 'clean_namespace' => true,
84 'no_leading_namespace_whitespace' => true,
85 'single_blank_line_before_namespace' => true,
86
87 'no_homoglyph_names' => true,
88
89 'binary_operator_spaces' => true,
90 'concat_space' => ['spacing' => 'one'],
91 'increment_style' => ['style' => 'post'],
92 'logical_operators' => true,
93 'object_operator_without_whitespace' => true,
94 'operator_linebreak' => true,
95 'standardize_increment' => true,
96 'standardize_not_equals' => true,
97 'ternary_operator_spaces' => true,
98 'ternary_to_elvis_operator' => true,
99 'ternary_to_null_coalescing' => true,
100 'unary_operator_spaces' => true,
101
102 'no_useless_return' => true,
103 'return_assignment' => true,
a9229942
TD
104
105 'multiline_whitespace_before_semicolons' => true,
106 'no_empty_statement' => true,
107 'no_singleline_whitespace_before_semicolons' => true,
108 'space_after_semicolon' => ['remove_in_empty_for_expressions' => true],
109
110 'escape_implicit_backslashes' => true,
111 'explicit_string_variable' => true,
112 'heredoc_to_nowdoc' => true,
113 'no_binary_string' => true,
114 'simple_to_complex_string_variable' => true,
115
116 'array_indentation' => true,
117 'blank_line_before_statement' => ['statements' => ['return', 'exit']],
118 'compact_nullable_typehint' => true,
119 'method_chaining_indentation' => true,
120 'no_extra_blank_lines' => ['tokens' => ['case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'square_brace_block', 'switch', 'throw', 'use', 'use_trait']],
121 'no_spaces_around_offset' => true,
122 ])
123 ->setFinder($finder);