|
1 | 1 | <?php |
2 | 2 |
|
3 | | -$finder = PhpCsFixer\Finder::create() |
| 3 | +use PhpCsFixer\Finder as PhpCsFixerFinder; |
| 4 | +use PhpCsFixer\Config as PhpCsFixerConfig; |
| 5 | +use PhpCsFixer\Runner\Parallel\ParallelConfigFactory; |
| 6 | + |
| 7 | +$finder = PhpCsFixerFinder::create() |
4 | 8 | ->in(__DIR__) |
5 | 9 | ->exclude('vendor') |
6 | 10 | ->exclude('vendor-bin') |
7 | 11 | ; |
8 | 12 |
|
9 | | -$config = new PhpCsFixer\Config(); |
| 13 | +$config = new PhpCsFixerConfig(); |
10 | 14 | return $config |
| 15 | + ->setParallelConfig(ParallelConfigFactory::detect()) |
11 | 16 | ->setRules([ |
12 | 17 | '@PER-CS' => true, |
13 | 18 | 'binary_operator_spaces' => ['default' => 'at_least_single_space', 'operators' => ['=>' => 'align']], |
14 | 19 | 'declare_strict_types' => true, |
15 | 20 | 'no_alias_functions' => true, |
| 21 | + 'no_unused_imports' => true, |
16 | 22 | 'no_useless_sprintf' => true, |
17 | | - 'nullable_type_declaration_for_default_null_value' => false, // should be 'true' when we drop support for PHP 7.0 which didn't support nullable types yet |
| 23 | + 'nullable_type_declaration_for_default_null_value' => true, |
18 | 24 | 'ordered_imports' => ['sort_algorithm' => 'alpha'], |
19 | 25 | 'phpdoc_align' => ['align' => 'vertical'], |
20 | 26 | 'phpdoc_separation' => ['skip_unlisted_annotations' => true], |
21 | 27 | 'self_accessor' => true, |
22 | | - 'visibility_required' => ['elements' => ['property', 'method']], // removed 'const' since we still support PHP 7.0 for now |
| 28 | + 'trailing_comma_in_multiline' => ['after_heredoc' => true, 'elements' => ['arrays']], // remove this line when we drop support for PHP < 8.0 |
23 | 29 | ]) |
24 | 30 | ->setFinder($finder) |
25 | 31 | ; |
0 commit comments