|
1 | 1 | <?php
|
2 | 2 |
|
3 |
| -return JanaSeta\PhpCs\Fix::in([ |
4 |
| - 'src', |
| 3 | +$finder = PhpCsFixer\Finder::create()->in([ |
| 4 | + 'src', |
5 | 5 | 'tests',
|
6 |
| -])->addRules([ |
7 |
| - '@PHP81Migration' => true, |
8 | 6 | ]);
|
| 7 | + |
| 8 | +return (new PhpCsFixer\Config)->setFinder($finder) |
| 9 | + ->setIndent("\t") |
| 10 | + ->setRiskyAllowed(true) |
| 11 | + ->setLineEnding("\n") |
| 12 | + ->setRules([ |
| 13 | + '@PHP80Migration:risky' => true, |
| 14 | + '@PHP84Migration' => true, |
| 15 | + '@PER-CS2.0' => true, |
| 16 | + '@Symfony:risky' => true, |
| 17 | + '@Symfony' => true, |
| 18 | + |
| 19 | + // Overrides `@PHP80Migration:risky` |
| 20 | + 'declare_strict_types' => false, |
| 21 | + |
| 22 | + // Overrides `@PHP84Migration` |
| 23 | + 'nullable_type_declaration_for_default_null_value' => false, |
| 24 | + |
| 25 | + // Overrides `@Symfony:risky` |
| 26 | + 'is_null' => false, |
| 27 | + |
| 28 | + // Overrides `@PER-CS2.0` |
| 29 | + 'new_with_parentheses' => [ |
| 30 | + 'anonymous_class' => false, |
| 31 | + 'named_class' => false, |
| 32 | + ], |
| 33 | + 'trailing_comma_in_multiline' => [ |
| 34 | + 'elements' => ['arrays', 'match', 'parameters'], |
| 35 | + ], |
| 36 | + 'control_structure_braces' => false, |
| 37 | + 'concat_space' => [ |
| 38 | + 'spacing' => 'none', |
| 39 | + ], |
| 40 | + |
| 41 | + // Overrides `@Symfony` |
| 42 | + 'phpdoc_summary' => false, |
| 43 | + 'ordered_imports' => false, // |
| 44 | + 'global_namespace_import' => false, |
| 45 | + 'single_line_throw' => false, |
| 46 | + // Disabled to allow no separation between interface/abstract methods |
| 47 | + 'class_attributes_separation' => false, |
| 48 | + |
| 49 | + // Additional |
| 50 | + 'single_line_empty_body' => true, |
| 51 | + ]); |
| 52 | + |
0 commit comments