|
| 1 | +<?php |
| 2 | + |
| 3 | +$finder = Symfony\Component\Finder\Finder::create() |
| 4 | + ->in([ |
| 5 | + __DIR__ . '/php', |
| 6 | + __DIR__ . '/app/app', |
| 7 | + __DIR__ . '/app/config', |
| 8 | + __DIR__ . '/app/database', |
| 9 | + __DIR__ . '/app/lang', |
| 10 | + __DIR__ . '/app/routes', |
| 11 | + __DIR__ . '/app/tests', |
| 12 | + ]) |
| 13 | + ->name('*.php') |
| 14 | + ->ignoreDotFiles(true) |
| 15 | + ->ignoreVCS(true); |
| 16 | + |
| 17 | +return (new PhpCsFixer\Config()) |
| 18 | + ->setRules([ |
| 19 | + '@PHP70Migration' => true, |
| 20 | + '@PHP71Migration' => true, |
| 21 | + '@PHP73Migration' => true, |
| 22 | + '@PHP74Migration' => true, |
| 23 | + '@PHP80Migration' => true, |
| 24 | + '@PSR2' => true, |
| 25 | + 'array_indentation' => true, |
| 26 | + 'binary_operator_spaces' => ['default' => 'align_single_space_minimal'], |
| 27 | + 'blank_line_before_statement' => ['statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try']], |
| 28 | + 'class_attributes_separation' => ['elements' => ['method' => 'one']], |
| 29 | + 'concat_space' => ['spacing' => 'one'], |
| 30 | + 'increment_style' => ['style' => 'post'], |
| 31 | + 'method_argument_space' => ['on_multiline' => 'ensure_fully_multiline', 'keep_multiple_spaces_after_comma' => true], |
| 32 | + 'method_chaining_indentation' => true, |
| 33 | + 'multiline_whitespace_before_semicolons' => ['strategy' => 'no_multi_line'], |
| 34 | + 'no_extra_blank_lines' => true, |
| 35 | + 'no_trailing_comma_in_singleline_array' => true, |
| 36 | + 'no_unused_imports' => true, |
| 37 | + 'no_whitespace_before_comma_in_array' => true, |
| 38 | + 'not_operator_with_successor_space' => false, |
| 39 | + 'ordered_imports' => true, |
| 40 | + 'phpdoc_scalar' => true, |
| 41 | + 'phpdoc_single_line_var_spacing' => true, |
| 42 | + 'phpdoc_var_without_name' => true, |
| 43 | + 'return_type_declaration' => ['space_before' => 'none'], |
| 44 | + 'semicolon_after_instruction' => false, |
| 45 | + 'simple_to_complex_string_variable' => true, |
| 46 | + 'strict_comparison' => true, |
| 47 | + 'ternary_operator_spaces' => true, |
| 48 | + 'trailing_comma_in_multiline' => true, |
| 49 | + 'trim_array_spaces' => true, |
| 50 | + 'unary_operator_spaces' => true, |
| 51 | + 'yoda_style' => false, |
| 52 | + ]) |
| 53 | + ->setFinder($finder) |
| 54 | + ->setRiskyAllowed(true) |
| 55 | + ->setUsingCache(false); |
0 commit comments