|
| 1 | +<?php |
| 2 | + |
| 3 | +$finder = PhpCsFixer\Finder::create() |
| 4 | + ->in([ |
| 5 | + __DIR__ . '/src', |
| 6 | + __DIR__ . '/tests', |
| 7 | + __DIR__ . '/common', |
| 8 | + __DIR__ . '/config', |
| 9 | + ]) |
| 10 | + ->name('*.php') |
| 11 | + ->ignoreDotFiles(true) |
| 12 | + ->ignoreVCS(true); |
| 13 | + |
| 14 | +return (new PhpCsFixer\Config()) |
| 15 | + ->setRules([ |
| 16 | + '@PSR12' => true, |
| 17 | + 'simplified_null_return' => true, |
| 18 | + 'braces' => false, |
| 19 | + 'new_with_braces' => [ |
| 20 | + 'anonymous_class' => false, |
| 21 | + 'named_class' => false, |
| 22 | + ], |
| 23 | + 'array_syntax' => ['syntax' => 'short'], |
| 24 | + 'ordered_imports' => ['sort_algorithm' => 'alpha'], |
| 25 | + 'no_unused_imports' => true, |
| 26 | + 'trailing_comma_in_multiline' => true, |
| 27 | + 'phpdoc_scalar' => true, |
| 28 | + 'unary_operator_spaces' => true, |
| 29 | + 'binary_operator_spaces' => true, |
| 30 | + 'blank_line_before_statement' => [ |
| 31 | + 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'], |
| 32 | + ], |
| 33 | + 'phpdoc_single_line_var_spacing' => true, |
| 34 | + 'phpdoc_var_without_name' => true, |
| 35 | + 'class_attributes_separation' => [ |
| 36 | + 'elements' => [ |
| 37 | + 'const' => 'one', |
| 38 | + 'method' => 'one', |
| 39 | + 'property' => 'one', |
| 40 | + ], |
| 41 | + ], |
| 42 | + 'method_argument_space' => [ |
| 43 | + 'on_multiline' => 'ensure_fully_multiline', |
| 44 | + 'keep_multiple_spaces_after_comma' => true, |
| 45 | + ], |
| 46 | + 'single_trait_insert_per_statement' => true, |
| 47 | + 'blank_lines_before_namespace' => true, |
| 48 | + 'doctrine_annotation_indentation' => true, |
| 49 | + 'doctrine_annotation_spaces' => true, |
| 50 | + 'elseif' => true, |
| 51 | + 'full_opening_tag' => true, |
| 52 | + 'include' => true, |
| 53 | + 'php_unit_method_casing' => false, |
| 54 | + 'phpdoc_types' => true, |
| 55 | + 'phpdoc_types_order' => true, |
| 56 | + 'phpdoc_var_annotation_correct_order' => true, |
| 57 | + ]) |
| 58 | + ->setFinder($finder); |
0 commit comments