|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +use PhpCsFixer\Config; |
| 6 | +use PhpCsFixer\Finder; |
| 7 | +use PhpCsFixer\Runner\Parallel\ParallelConfigFactory; |
| 8 | + |
| 9 | +$finder = (new Finder())->in([ |
| 10 | + __DIR__ . '/config', |
| 11 | + __DIR__ . '/src', |
| 12 | + __DIR__ . '/tests', |
| 13 | +])->notPath([ |
| 14 | + 'MockHelper.php' |
| 15 | +]); |
| 16 | + |
| 17 | +// TODO: Update the configuration after raising the minimum PHP version |
| 18 | +return (new Config()) |
| 19 | + ->setRiskyAllowed(true) |
| 20 | + ->setParallelConfig(ParallelConfigFactory::detect()) |
| 21 | + ->setRules([ |
| 22 | + '@PER-CS2.0' => true, |
| 23 | + 'nullable_type_declaration' => true, |
| 24 | + 'operator_linebreak' => true, |
| 25 | + 'ordered_types' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], |
| 26 | + 'single_class_element_per_statement' => true, |
| 27 | + 'types_spaces' => true, |
| 28 | + 'no_unused_imports' => true, |
| 29 | + 'ordered_class_elements' => true, |
| 30 | + 'class_attributes_separation' => ['elements' => ['method' => 'one']], |
| 31 | + 'declare_strict_types' => true, |
| 32 | + 'native_function_invocation' => true, |
| 33 | + 'native_constant_invocation' => true, |
| 34 | + 'fully_qualified_strict_types' => [ |
| 35 | + 'import_symbols' => true |
| 36 | + ], |
| 37 | + 'global_namespace_import' => [ |
| 38 | + 'import_classes' => true, |
| 39 | + 'import_constants' => true, |
| 40 | + 'import_functions' => true, |
| 41 | + ], |
| 42 | + ]) |
| 43 | + ->setFinder($finder); |
0 commit comments