|
| 1 | +<?php |
| 2 | + |
| 3 | +return PhpCsFixer\Config::create() |
| 4 | + ->setRiskyAllowed(true) |
| 5 | + ->setRules( |
| 6 | + [ |
| 7 | + '@PSR2' => true, |
| 8 | + 'array_syntax' => ['syntax' => 'short'], |
| 9 | + 'binary_operator_spaces' => [ |
| 10 | + 'default' => 'align_single_space_minimal', |
| 11 | + ], |
| 12 | + 'blank_line_before_statement' => [ |
| 13 | + 'statements' => ['break', 'continue', 'return', 'try'], |
| 14 | + ], |
| 15 | + 'braces' => [ |
| 16 | + 'allow_single_line_closure' => true, |
| 17 | + ], |
| 18 | + 'class_attributes_separation' => [ |
| 19 | + 'elements' => ['const', 'property', 'method'], |
| 20 | + ], |
| 21 | + 'declare_strict_types' => true, |
| 22 | + 'no_alternative_syntax' => true, |
| 23 | + 'no_leading_import_slash' => true, |
| 24 | + 'no_multiline_whitespace_before_semicolons' => true, |
| 25 | + 'no_short_echo_tag' => true, |
| 26 | + 'no_spaces_inside_parenthesis' => true, |
| 27 | + 'no_useless_else' => true, |
| 28 | + 'not_operator_with_space' => false, |
| 29 | + 'not_operator_with_successor_space' => false, |
| 30 | + 'ordered_imports' => true, |
| 31 | + 'phpdoc_add_missing_param_annotation' => true, |
| 32 | + 'phpdoc_align' => [ |
| 33 | + 'align' => 'vertical', |
| 34 | + ], |
| 35 | + 'phpdoc_indent' => true, |
| 36 | + 'phpdoc_no_package' => true, |
| 37 | + 'phpdoc_order' => true, |
| 38 | + 'phpdoc_scalar' => [ |
| 39 | + 'types' => ['boolean', 'double', 'integer', 'real', 'str'], |
| 40 | + ], |
| 41 | + 'phpdoc_separation' => true, |
| 42 | + 'phpdoc_single_line_var_spacing' => true, |
| 43 | + 'phpdoc_to_comment' => true, |
| 44 | + 'phpdoc_trim' => true, |
| 45 | + 'phpdoc_var_without_name' => true, |
| 46 | + 'return_type_declaration' => [ |
| 47 | + 'space_before' => 'none', |
| 48 | + ], |
| 49 | + 'single_quote' => true, |
| 50 | + 'ternary_operator_spaces' => true, |
| 51 | + 'trailing_comma_in_multiline_array' => true, |
| 52 | + 'trim_array_spaces' => true, |
| 53 | + 'single_line_after_imports' => true, |
| 54 | + 'unary_operator_spaces' => true, |
| 55 | + 'visibility_required' => true, |
| 56 | + 'yoda_style' => false, |
| 57 | + ] |
| 58 | + ) |
| 59 | + ->setIndent(' ') |
| 60 | + ->setUsingCache(false) |
| 61 | + ->setFinder( |
| 62 | + PhpCsFixer\Finder::create() |
| 63 | + ->in(__DIR__.'/src') |
| 64 | + ->in(__DIR__.'/test') |
| 65 | + ->name('*.php') |
| 66 | + ); |
0 commit comments