|
| 1 | +<?php |
| 2 | + |
| 3 | +$finder = PhpCsFixer\Finder::create() |
| 4 | + ->in(__DIR__ . '/src') |
| 5 | + ->in(__DIR__ . '/tests') |
| 6 | + ->exclude('var') |
| 7 | + ->exclude('config') |
| 8 | + ->exclude('vendor'); |
| 9 | + |
| 10 | +return (new PhpCsFixer\Config()) |
| 11 | + ->setParallelConfig(new PhpCsFixer\Runner\Parallel\ParallelConfig(4, 20)) |
| 12 | + ->setRules([ |
| 13 | + '@PSR12' => true, |
| 14 | + '@Symfony' => true, |
| 15 | + 'full_opening_tag' => false, |
| 16 | + 'phpdoc_var_without_name' => false, |
| 17 | + 'phpdoc_to_comment' => false, |
| 18 | + 'array_syntax' => ['syntax' => 'short'], |
| 19 | + 'concat_space' => ['spacing' => 'one'], |
| 20 | + 'binary_operator_spaces' => [ |
| 21 | + 'default' => 'single_space', |
| 22 | + 'operators' => [ |
| 23 | + '=' => 'single_space', |
| 24 | + '=>' => 'single_space', |
| 25 | + ], |
| 26 | + ], |
| 27 | + 'blank_line_before_statement' => [ |
| 28 | + 'statements' => ['return'] |
| 29 | + ], |
| 30 | + 'cast_spaces' => ['space' => 'single'], |
| 31 | + 'class_attributes_separation' => [ |
| 32 | + 'elements' => [ |
| 33 | + 'const' => 'none', |
| 34 | + 'method' => 'one', |
| 35 | + 'property' => 'none' |
| 36 | + ] |
| 37 | + ], |
| 38 | + 'declare_equal_normalize' => ['space' => 'none'], |
| 39 | + 'function_typehint_space' => true, |
| 40 | + 'lowercase_cast' => true, |
| 41 | + 'no_unused_imports' => true, |
| 42 | + 'not_operator_with_successor_space' => true, |
| 43 | + 'ordered_imports' => true, |
| 44 | + 'phpdoc_align' => ['align' => 'left'], |
| 45 | + 'phpdoc_no_alias_tag' => ['replacements' => ['type' => 'var', 'link' => 'see']], |
| 46 | + 'phpdoc_order' => true, |
| 47 | + 'phpdoc_scalar' => true, |
| 48 | + 'single_quote' => true, |
| 49 | + 'standardize_not_equals' => true, |
| 50 | + 'trailing_comma_in_multiline' => ['elements' => ['arrays']], |
| 51 | + 'trim_array_spaces' => true, |
| 52 | + 'space_after_semicolon' => true, |
| 53 | + 'no_spaces_inside_parenthesis' => true, |
| 54 | + 'no_whitespace_before_comma_in_array' => true, |
| 55 | + 'whitespace_after_comma_in_array' => true, |
| 56 | + 'visibility_required' => ['elements' => ['const', 'method', 'property']], |
| 57 | + 'multiline_whitespace_before_semicolons' => [ |
| 58 | + 'strategy' => 'no_multi_line', |
| 59 | + ], |
| 60 | + 'method_chaining_indentation' => true, |
| 61 | + 'class_definition' => [ |
| 62 | + 'single_item_single_line' => false, |
| 63 | + 'multi_line_extends_each_single_line' => true, |
| 64 | + ], |
| 65 | + 'not_operator_with_successor_space' => false |
| 66 | + ]) |
| 67 | + ->setRiskyAllowed(true) |
| 68 | + ->setFinder($finder) |
| 69 | + ->setUsingCache(false); |
0 commit comments