-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecs.php
81 lines (72 loc) · 2.72 KB
/
ecs.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
declare(strict_types=1);
use PhpCsFixer\Fixer\Basic\PsrAutoloadingFixer;
use PhpCsFixer\Fixer\CastNotation\NoUnsetCastFixer;
use PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer;
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
use PhpCsFixer\Fixer\Import\OrderedImportsFixer;
use PhpCsFixer\Fixer\NamespaceNotation\CleanNamespaceFixer;
use PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer;
use PhpCsFixer\Fixer\Phpdoc\NoBlankLinesAfterPhpdocFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocLineSpanFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocSummaryFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocToCommentFixer;
use PhpCsFixer\Fixer\PhpUnit\PhpUnitInternalClassFixer;
use PhpCsFixer\Fixer\PhpUnit\PhpUnitMethodCasingFixer;
use PhpCsFixer\Fixer\PhpUnit\PhpUnitTestClassRequiresCoversFixer;
use PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer;
use PhpCsFixer\Fixer\Strict\StrictComparisonFixer;
use PhpCsFixer\Fixer\StringNotation\SimpleToComplexStringVariableFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
return static function (ECSConfig $ecsConfig): void {
$ecsConfig->import(SetList::COMMON);
$ecsConfig->import(SetList::PSR_12);
$ecsConfig->import(SetList::CLEAN_CODE);
$ecsConfig->import(SetList::ARRAY);
$ecsConfig->dynamicSets(['@Symfony', '@PHP82Migration']);
$ecsConfig->cacheDirectory('.ecs_cache');
$ecsConfig->parallel();
$ecsConfig->paths([
__DIR__.'/src',
]);
$ecsConfig->rules([
DeclareStrictTypesFixer::class,
OrderedImportsFixer::class,
NoUnusedImportsFixer::class,
StrictComparisonFixer::class,
CleanNamespaceFixer::class,
NoUnsetCastFixer::class,
SimpleToComplexStringVariableFixer::class,
PsrAutoloadingFixer::class,
]);
$ecsConfig->ruleWithConfiguration(YodaStyleFixer::class, [
'equal' => true,
'identical' => true,
'less_and_greater' => true,
]);
$ecsConfig->ruleWithConfiguration(PhpdocAlignFixer::class, [
'align' => 'left',
'tags' => [
'method',
'param',
'property',
'return',
'throws',
'type',
'var',
],
]);
$ecsConfig->skip([
__DIR__.'/src/**/tests/app/*',
PhpUnitTestClassRequiresCoversFixer::class => ['*Test.php'],
PhpUnitInternalClassFixer::class => ['*Test.php'],
PhpUnitMethodCasingFixer::class => ['*Test.php'],
NotOperatorWithSuccessorSpaceFixer::class,
PhpdocToCommentFixer::class,
PhpdocSummaryFixer::class,
PhpdocLineSpanFixer::class,
NoBlankLinesAfterPhpdocFixer::class,
]);
};