|
| 1 | +<?php |
| 2 | + |
| 3 | +$finder = PhpCsFixer\Finder::create() |
| 4 | + ->in('examples/') |
| 5 | + ->in('src/') |
| 6 | + ->in('tests/') |
| 7 | +; |
| 8 | + |
| 9 | +return (new PhpCsFixer\Config()) |
| 10 | + ->setRules([ |
| 11 | + '@PSR12' => true, |
| 12 | + 'array_syntax' => [ |
| 13 | + 'syntax' => 'short' |
| 14 | + ], |
| 15 | + 'binary_operator_spaces' => [ |
| 16 | + 'operators' => ['=' => 'align'] |
| 17 | + ], |
| 18 | + 'blank_line_after_namespace' => true, |
| 19 | + 'blank_line_before_statement' => [ |
| 20 | + 'statements' => ['declare', 'return'] |
| 21 | + ], |
| 22 | + 'blank_line_between_import_groups' => true, |
| 23 | + 'concat_space' => [ |
| 24 | + 'spacing' => 'one' |
| 25 | + ], |
| 26 | + 'constant_case' => true, |
| 27 | + 'braces_position' => [ |
| 28 | + 'functions_opening_brace' => 'next_line_unless_newline_at_signature_end', |
| 29 | + 'allow_single_line_empty_anonymous_classes' => true, |
| 30 | + 'allow_single_line_anonymous_functions' => true |
| 31 | + ], |
| 32 | + 'declare_equal_normalize' => [ |
| 33 | + 'space' => 'none' |
| 34 | + ], |
| 35 | + 'elseif' => true, |
| 36 | + 'encoding' => true, |
| 37 | + 'full_opening_tag' => true, |
| 38 | + 'line_ending' => true, |
| 39 | + 'lowercase_cast' => true, |
| 40 | + 'method_argument_space' => true, |
| 41 | + 'multiline_comment_opening_closing' => true, |
| 42 | + 'no_break_comment' => false, |
| 43 | + 'no_trailing_whitespace' => true, |
| 44 | + 'no_trailing_whitespace_in_comment' => true, |
| 45 | + 'no_whitespace_in_blank_line' => true, |
| 46 | + 'return_type_declaration' => [ |
| 47 | + 'space_before' => 'none', |
| 48 | + ], |
| 49 | + 'single_blank_line_at_eof' => true, |
| 50 | + 'strict_param' => false, |
| 51 | + 'visibility_required' => true, |
| 52 | + 'no_unused_imports' => true, |
| 53 | + ]) |
| 54 | + ->setIndent(" ") |
| 55 | + ->setFinder($finder) |
| 56 | + ->setLineEnding("\n") |
| 57 | + ->setUsingCache(true) |
| 58 | + ->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect()) |
| 59 | +; |
| 60 | + |
0 commit comments