|
| 1 | +<?php |
| 2 | + |
| 3 | +$finder = PhpCsFixer\Finder::create()->in(__DIR__); |
| 4 | + |
| 5 | +return (new PhpCsFixer\Config()) |
| 6 | + ->setRules([ |
| 7 | + '@PSR12' => true, |
| 8 | + 'array_syntax' => [ |
| 9 | + 'syntax' => 'short', |
| 10 | + ], |
| 11 | + 'binary_operator_spaces' => [ |
| 12 | + 'operators' => [ |
| 13 | + '=>' => 'align', |
| 14 | + '=' => 'align', |
| 15 | + ], |
| 16 | + ], |
| 17 | + 'concat_space' => [ |
| 18 | + 'spacing' => 'one', |
| 19 | + ], |
| 20 | + 'declare_strict_types' => true, |
| 21 | + 'type_declaration_spaces' => true, |
| 22 | + 'single_line_comment_style' => [ |
| 23 | + 'comment_types' => ['hash'], |
| 24 | + ], |
| 25 | + 'lowercase_cast' => true, |
| 26 | + 'class_attributes_separation' => [ |
| 27 | + 'elements' => ['method' => 'one', 'property' => 'one', 'const' => 'one'], |
| 28 | + ], |
| 29 | + 'native_function_casing' => true, |
| 30 | + 'new_with_parentheses' => true, |
| 31 | + 'no_alias_functions' => true, |
| 32 | + 'no_blank_lines_after_class_opening' => true, |
| 33 | + 'no_blank_lines_after_phpdoc' => true, |
| 34 | + 'no_empty_comment' => true, |
| 35 | + 'no_empty_phpdoc' => true, |
| 36 | + 'no_empty_statement' => true, |
| 37 | + 'no_extra_blank_lines' => true, |
| 38 | + 'no_leading_import_slash' => true, |
| 39 | + 'no_leading_namespace_whitespace' => true, |
| 40 | + 'no_multiline_whitespace_around_double_arrow' => true, |
| 41 | + 'multiline_whitespace_before_semicolons' => false, |
| 42 | + 'no_short_bool_cast' => true, |
| 43 | + 'no_singleline_whitespace_before_semicolons' => true, |
| 44 | + 'no_spaces_around_offset' => true, |
| 45 | + 'no_trailing_comma_in_singleline' => true, |
| 46 | + 'no_unreachable_default_argument_value' => true, |
| 47 | + 'no_unused_imports' => true, |
| 48 | + 'no_useless_else' => true, |
| 49 | + 'no_useless_return' => true, |
| 50 | + 'no_whitespace_before_comma_in_array' => true, |
| 51 | + 'object_operator_without_whitespace' => true, |
| 52 | + 'ordered_imports' => true, |
| 53 | + 'phpdoc_align' => true, |
| 54 | + 'phpdoc_indent' => true, |
| 55 | + 'general_phpdoc_tag_rename' => true, |
| 56 | + 'phpdoc_inline_tag_normalizer' => true, |
| 57 | + 'phpdoc_tag_type' => true, |
| 58 | + 'phpdoc_order' => true, |
| 59 | + 'phpdoc_scalar' => true, |
| 60 | + 'phpdoc_separation' => true, |
| 61 | + 'phpdoc_single_line_var_spacing' => true, |
| 62 | + 'phpdoc_summary' => true, |
| 63 | + 'phpdoc_to_comment' => true, |
| 64 | + 'phpdoc_trim' => true, |
| 65 | + 'phpdoc_types' => true, |
| 66 | + 'self_accessor' => true, |
| 67 | + 'short_scalar_cast' => true, |
| 68 | + 'single_quote' => true, |
| 69 | + 'space_after_semicolon' => true, |
| 70 | + 'standardize_not_equals' => true, |
| 71 | + 'trailing_comma_in_multiline' => [ |
| 72 | + 'elements' => ['arrays'], |
| 73 | + ], |
| 74 | + 'trim_array_spaces' => true, |
| 75 | + 'unary_operator_spaces' => true, |
| 76 | + 'whitespace_after_comma_in_array' => true, |
| 77 | + ]) |
| 78 | + ->setRiskyAllowed(true) |
| 79 | + ->setUsingCache(true) |
| 80 | + ->setFinder($finder); |
0 commit comments