|
| 1 | +<?php |
| 2 | + |
| 3 | +$finder = PhpCsFixer\Finder::create() |
| 4 | + ->exclude('vendor') |
| 5 | + ->exclude('public') |
| 6 | + ->exclude('app') |
| 7 | + ->exclude('var') |
| 8 | + ->exclude('node_modules') |
| 9 | + ->exclude('cache') |
| 10 | + ->in(__DIR__); |
| 11 | + |
| 12 | +$config = new PhpCsFixer\Config(); |
| 13 | + |
| 14 | +return $config->setUsingCache(true) |
| 15 | + ->setCacheFile(sprintf('%s/cache/.php-cs-fixer.cache', __DIR__)) |
| 16 | + ->setRiskyAllowed(true) |
| 17 | + ->setRules([ |
| 18 | + '@PSR12' => true, |
| 19 | + '@PHP56Migration:risky' => true, |
| 20 | + '@PHP70Migration' => true, |
| 21 | + '@PHP70Migration:risky' => true, |
| 22 | + '@PHP71Migration' => true, |
| 23 | + '@PHP71Migration:risky' => true, |
| 24 | + '@PHP73Migration' => true, |
| 25 | + '@PHP74Migration' => true, |
| 26 | + '@PHP74Migration:risky' => true, |
| 27 | + '@PHP80Migration' => true, |
| 28 | + '@PHP80Migration:risky' => true, |
| 29 | + '@PhpCsFixer' => true, |
| 30 | + '@PhpCsFixer:risky' => false, |
| 31 | + '@Symfony' => true, |
| 32 | + '@Symfony:risky' => true, |
| 33 | + '@DoctrineAnnotation' => true, |
| 34 | + 'function_declaration' => ['closure_fn_spacing' => 'none'], |
| 35 | + 'list_syntax' => ['syntax' => 'short'], |
| 36 | + 'single_line_empty_body' => false, |
| 37 | + 'strict_comparison' => false, |
| 38 | + 'binary_operator_spaces' => [ |
| 39 | + 'operators' => [ |
| 40 | + '=' => 'single_space', |
| 41 | + '=>' => 'single_space', |
| 42 | + '+=' => 'single_space', |
| 43 | + '-=' => 'single_space', |
| 44 | + '*=' => 'single_space', |
| 45 | + '%=' => 'single_space', |
| 46 | + '.=' => 'single_space', |
| 47 | + '^=' => 'single_space', |
| 48 | + ], |
| 49 | + ], |
| 50 | + 'concat_space' => ['spacing' => 'one'], |
| 51 | + 'yoda_style' => false, |
| 52 | + 'class_definition' => [ |
| 53 | + 'single_line' => false, |
| 54 | + ], |
| 55 | + 'native_function_invocation' => true, |
| 56 | + 'native_function_casing' => true, |
| 57 | + 'native_constant_invocation' => true, |
| 58 | + 'object_operator_without_whitespace' => false, |
| 59 | + 'operator_linebreak' => true, |
| 60 | + 'multiline_whitespace_before_semicolons' => [ |
| 61 | + 'strategy' => 'no_multi_line', |
| 62 | + ], |
| 63 | + 'phpdoc_to_comment' => false, |
| 64 | + 'php_unit_test_case_static_method_calls' => false, |
| 65 | + 'global_namespace_import' => [ |
| 66 | + 'import_classes' => true, |
| 67 | + 'import_constants' => true, |
| 68 | + 'import_functions' => true, |
| 69 | + ], |
| 70 | + 'ordered_imports' => [ |
| 71 | + 'sort_algorithm' => 'alpha', |
| 72 | + 'imports_order' => [ |
| 73 | + 'const', |
| 74 | + 'class', |
| 75 | + 'function', |
| 76 | + ] |
| 77 | + ], |
| 78 | + ]) |
| 79 | + ->setFinder($finder); |
0 commit comments