|
1 | 1 | <?php |
2 | 2 | $finder = PhpCsFixer\Finder::create() |
3 | 3 | ->exclude('*/vendor/*') |
4 | | - ->in(__DIR__.'/files/'); |
| 4 | + ->in(__DIR__ . '/files/'); |
5 | 5 |
|
6 | 6 | return (new PhpCsFixer\Config()) |
7 | 7 | ->setRiskyAllowed(true) |
8 | 8 | ->setRules([ |
9 | | - '@PER-CS2.0' => true, |
10 | | - 'single_line_empty_body' => false, |
| 9 | + '@PSR1' => true, |
| 10 | + '@PSR2' => true, |
11 | 11 |
|
12 | 12 | 'array_push' => true, |
13 | 13 | 'backtick_to_shell_exec' => true, |
|
25 | 25 |
|
26 | 26 | 'non_printable_character' => ['use_escape_sequences_in_strings' => true], |
27 | 27 |
|
| 28 | + 'lowercase_static_reference' => true, |
28 | 29 | 'magic_constant_casing' => true, |
29 | 30 | 'magic_method_casing' => true, |
30 | 31 | 'native_function_casing' => true, |
31 | 32 | 'native_function_type_declaration_casing' => true, |
32 | 33 |
|
33 | 34 | 'cast_spaces' => ['space' => 'none'], |
| 35 | + 'lowercase_cast' => true, |
34 | 36 | 'no_unset_cast' => true, |
| 37 | + 'short_scalar_cast' => true, |
35 | 38 |
|
36 | 39 | 'class_attributes_separation' => true, |
| 40 | + 'no_blank_lines_after_class_opening' => true, |
37 | 41 | 'no_null_property_initialization' => true, |
38 | 42 | 'self_accessor' => true, |
39 | 43 | 'single_class_element_per_statement' => true, |
| 44 | + 'single_trait_insert_per_statement' => true, |
40 | 45 |
|
41 | 46 | 'no_empty_comment' => true, |
42 | 47 | 'single_line_comment_style' => ['comment_types' => ['hash']], |
|
55 | 60 | 'native_function_invocation' => ['include' => ['@internal']], |
56 | 61 | 'no_unreachable_default_argument_value' => true, |
57 | 62 | 'nullable_type_declaration_for_default_null_value' => true, |
| 63 | + 'return_type_declaration' => true, |
58 | 64 | 'static_lambda' => true, |
59 | 65 |
|
60 | 66 | 'fully_qualified_strict_types' => ['leading_backslash_in_global_namespace' => true], |
| 67 | + 'no_leading_import_slash' => true, |
61 | 68 | 'no_unused_imports' => true, |
62 | 69 | 'ordered_imports' => true, |
63 | 70 |
|
| 71 | + 'declare_equal_normalize' => true, |
64 | 72 | 'dir_constant' => true, |
65 | 73 | 'explicit_indirect_variable' => true, |
66 | 74 | 'function_to_constant' => true, |
|
71 | 79 |
|
72 | 80 | 'clean_namespace' => true, |
73 | 81 | 'no_leading_namespace_whitespace' => true, |
| 82 | + 'single_blank_line_before_namespace' => true, |
74 | 83 |
|
75 | 84 | 'no_homoglyph_names' => true, |
76 | 85 |
|
|
82 | 91 | 'operator_linebreak' => true, |
83 | 92 | 'standardize_increment' => true, |
84 | 93 | 'standardize_not_equals' => true, |
| 94 | + 'ternary_operator_spaces' => true, |
85 | 95 | 'ternary_to_elvis_operator' => true, |
86 | 96 | 'ternary_to_null_coalescing' => true, |
87 | 97 | 'unary_operator_spaces' => true, |
|
102 | 112 |
|
103 | 113 | 'array_indentation' => true, |
104 | 114 | 'blank_line_before_statement' => ['statements' => ['return', 'exit']], |
| 115 | + 'compact_nullable_typehint' => true, |
105 | 116 | 'method_chaining_indentation' => true, |
106 | 117 | 'no_extra_blank_lines' => ['tokens' => ['case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'square_brace_block', 'switch', 'throw', 'use']], |
107 | 118 | 'no_spaces_around_offset' => true, |
|
0 commit comments