|
| 1 | +<?php |
| 2 | + |
| 3 | +$finder = Symfony\Component\Finder\Finder::create() |
| 4 | + ->notPath('bootstrap/*') |
| 5 | + ->notPath('storage/*') |
| 6 | + ->notPath('resources/view/mail/*') |
| 7 | + ->in([ |
| 8 | + __DIR__ . '/src', |
| 9 | + __DIR__ . '/tests', |
| 10 | + ]) |
| 11 | + ->name('*.php') |
| 12 | + ->notName('*.blade.php') |
| 13 | + ->ignoreDotFiles(true) |
| 14 | + ->ignoreVCS(true); |
| 15 | + |
| 16 | +return (new PhpCsFixer\Config()) |
| 17 | + ->setRules([ |
| 18 | + '@PSR2' => true, |
| 19 | + 'array_syntax' => ['syntax' => 'short'], |
| 20 | + 'ordered_imports' => ['sort_algorithm' => 'alpha'], |
| 21 | + 'no_unused_imports' => true, |
| 22 | + 'not_operator_with_successor_space' => true, |
| 23 | + 'trailing_comma_in_multiline' => true, |
| 24 | + 'phpdoc_scalar' => true, |
| 25 | + 'unary_operator_spaces' => true, |
| 26 | + 'binary_operator_spaces' => true, |
| 27 | + 'blank_line_before_statement' => [ |
| 28 | + 'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'], |
| 29 | + ], |
| 30 | + 'phpdoc_single_line_var_spacing' => true, |
| 31 | + 'phpdoc_var_without_name' => true, |
| 32 | + 'class_attributes_separation' => [ |
| 33 | + 'elements' => [ |
| 34 | + 'method' => 'one', |
| 35 | + ], |
| 36 | + ], |
| 37 | + 'method_argument_space' => [ |
| 38 | + 'on_multiline' => 'ensure_fully_multiline', |
| 39 | + 'keep_multiple_spaces_after_comma' => true, |
| 40 | + ], |
| 41 | + 'single_trait_insert_per_statement' => true, |
| 42 | + ]) |
| 43 | + ->setFinder($finder); |
0 commit comments