|
1 | 1 | <?php
|
2 | 2 |
|
3 |
| -$finder = Symfony\CS\Finder\DefaultFinder::create() |
4 |
| - ->in(['lib', 'test']); |
| 3 | +$finder = PhpCsFixer\Finder::create() |
| 4 | + ->exclude(['vendor', 'var']) |
| 5 | + ->in([__DIR__]) |
| 6 | +; |
5 | 7 |
|
6 |
| -$config = Symfony\CS\Config\Config::create() |
7 |
| - ->setUsingCache(true) |
8 |
| - ->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL) |
9 |
| - ->fixers([ |
10 |
| - // [contrib] Multi-line whitespace before closing semicolon are prohibited. |
11 |
| - 'multiline_spaces_before_semicolon', |
12 |
| - // [contrib] There should be no blank lines before a namespace declaration. |
13 |
| - 'no_blank_lines_before_namespace', |
14 |
| - // [contrib] Ordering use statements. |
15 |
| - 'ordered_use', |
16 |
| - // [contrib] Annotations should be ordered so that param annotations come first, then throws annotations, then return annotations. |
17 |
| - 'phpdoc_order', |
18 |
| - // [contrib] Arrays should use the short syntax. |
19 |
| - 'short_array_syntax', |
20 |
| - // [contrib] Ensure there is no code on the same line as the PHP open tag. |
21 |
| - 'newline_after_open_tag', |
22 |
| - // [contrib] Use null coalescing operator ?? where possible |
23 |
| - 'ternary_to_null_coalescing', |
24 |
| - // [contrib] There should not be useless else cases. |
25 |
| - 'no_useless_else', |
26 |
| - // [contrib] Use dedicated PHPUnit assertions for better error messages. |
| 8 | +$config = PhpCsFixer\Config::create() |
| 9 | + ->setFinder($finder) |
| 10 | + ->setRules([ |
| 11 | + '@PSR2' => true, |
| 12 | + '@Symfony' => true, |
| 13 | + 'psr0' => false, |
| 14 | + 'single_blank_line_before_namespace' => false, |
| 15 | + 'ordered_imports' => true, |
| 16 | + 'array_syntax' => ['syntax' => 'short'], |
| 17 | + 'phpdoc_order' => true, |
| 18 | + 'blank_line_after_namespace' => true, |
| 19 | + 'ternary_to_null_coalescing' => true, |
| 20 | + 'no_useless_else' => true, |
27 | 21 | '@PHPUnit60Migration:risky' => true,
|
28 |
| - //'php_unit_dedicate_assert' => ['target' => 'newest'], |
| 22 | + 'php_unit_dedicate_assert' => ['target' => 'newest'], |
29 | 23 | ])
|
30 |
| - ->finder($finder); |
| 24 | +; |
31 | 25 |
|
32 | 26 | return $config;
|
0 commit comments