-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecs.php
43 lines (36 loc) · 1.67 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
<?php
declare(strict_types=1);
use PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer;
use PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer;
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
use PhpCsFixer\Fixer\Import\OrderedImportsFixer;
use PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer;
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 Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
return static function (ECSConfig $ecsConfig): void {
$ecsConfig->import(SetList::PSR_12);
$services = $ecsConfig->services();
$services->set(DeclareStrictTypesFixer::class);
$services->set(OrderedImportsFixer::class);
$services->set(NoUnusedImportsFixer::class);
$services->set(StrictComparisonFixer::class);
$services->set(PhpdocAlignFixer::class)
->call('configure', [[
'align' => 'left',
'tags' => ['method', 'param', 'property', 'return', 'throws', 'type', 'var'],
]]);
$services->set(TrailingCommaInMultilineFixer::class)
->call('configure', [['elements' => ['arrays', 'arguments', 'parameters']]]);
$parameters = $ecsConfig->parameters();
$parameters->set('skip', [
VisibilityRequiredFixer::class => ['*Spec.php'],
PhpUnitTestClassRequiresCoversFixer::class => ['*Test.php'],
PhpUnitInternalClassFixer::class => ['*Test.php'],
PhpUnitMethodCasingFixer::class => ['*Test.php'],
]);
};