|
2 | 2 |
|
3 | 3 | declare(strict_types=1); |
4 | 4 |
|
5 | | -use PhpCsFixer\Fixer\ClassNotation\{ClassDefinitionFixer, OrderedClassElementsFixer, OrderedTraitsFixer}; |
6 | | -use PhpCsFixer\Fixer\Import\{NoUnusedImportsFixer, OrderedImportsFixer}; |
7 | | -use PhpCsFixer\Fixer\Phpdoc\PhpdocTypesOrderFixer; |
8 | | -use PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer; |
9 | | -use PhpCsFixer\Fixer\LanguageConstruct\NullableTypeDeclarationFixer; |
10 | | -use Symplify\EasyCodingStandard\Config\ECSConfig; |
| 5 | +/** @var \Symplify\EasyCodingStandard\Configuration\ECSConfigBuilder $ecsConfigBuilder */ |
| 6 | +$ecsConfigBuilder = require __DIR__ . '/vendor/php-forge/coding-standard/config/ecs.php'; |
11 | 7 |
|
12 | | -return ECSConfig::configure() |
13 | | - ->withConfiguredRule( |
14 | | - ClassDefinitionFixer::class, |
15 | | - [ |
16 | | - 'space_before_parenthesis' => true, |
17 | | - ], |
18 | | - ) |
19 | | - ->withConfiguredRule( |
20 | | - OrderedClassElementsFixer::class, |
21 | | - [ |
22 | | - 'order' => [ |
23 | | - 'use_trait', |
24 | | - 'constant_public', |
25 | | - 'constant_protected', |
26 | | - 'constant_private', |
27 | | - 'case', |
28 | | - 'property_public', |
29 | | - 'property_protected', |
30 | | - 'property_private', |
31 | | - 'construct', |
32 | | - 'destruct', |
33 | | - 'magic', |
34 | | - 'method_protected_abstract', |
35 | | - 'method_public', |
36 | | - 'method_protected', |
37 | | - 'method_private', |
38 | | - ], |
39 | | - 'sort_algorithm' => 'alpha', |
40 | | - ], |
41 | | - ) |
42 | | - ->withConfiguredRule( |
43 | | - OrderedImportsFixer::class, |
44 | | - [ |
45 | | - 'imports_order' => [ |
46 | | - 'class', |
47 | | - 'function', |
48 | | - 'const', |
49 | | - ], |
50 | | - 'sort_algorithm' => 'alpha', |
51 | | - ], |
52 | | - ) |
53 | | - ->withConfiguredRule( |
54 | | - PhpdocTypesOrderFixer::class, |
55 | | - [ |
56 | | - 'sort_algorithm' => 'none', |
57 | | - 'null_adjustment' => 'always_last', |
58 | | - ], |
59 | | - ) |
60 | | - ->withFileExtensions(['php']) |
61 | | - ->withPaths( |
62 | | - [ |
63 | | - __DIR__ . '/src', |
64 | | - __DIR__ . '/tests', |
65 | | - ], |
66 | | - ) |
67 | | - ->withPhpCsFixerSets(perCS30: true) |
68 | | - ->withPreparedSets( |
69 | | - cleanCode: true, |
70 | | - comments: true, |
71 | | - docblocks: true, |
72 | | - namespaces: true, |
73 | | - strict: true, |
74 | | - ) |
75 | | - ->withRules( |
76 | | - [ |
77 | | - NoUnusedImportsFixer::class, |
78 | | - OrderedTraitsFixer::class, |
79 | | - SingleQuoteFixer::class, |
80 | | - ] |
81 | | - ) |
82 | | - ->withSkip( |
83 | | - [ |
84 | | - NullableTypeDeclarationFixer::class, |
85 | | - ] |
86 | | - ); |
| 8 | +return $ecsConfigBuilder->withPaths( |
| 9 | + [ |
| 10 | + __DIR__ . '/src', |
| 11 | + __DIR__ . '/tests', |
| 12 | + ], |
| 13 | +); |
0 commit comments