forked from Payum/Payum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecs.php
55 lines (48 loc) · 2.04 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
<?php
declare(strict_types=1);
use PhpCsFixer\Fixer\Casing\MagicConstantCasingFixer;
use PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer;
use PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer;
use PhpCsFixer\Fixer\ClassNotation\SelfAccessorFixer;
use PhpCsFixer\Fixer\ClassNotation\SingleClassElementPerStatementFixer;
use PhpCsFixer\Fixer\ControlStructure\NoUselessElseFixer;
use PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer;
use PhpCsFixer\Fixer\Import\NoUnusedImportsFixer;
use PhpCsFixer\Fixer\LanguageConstruct\ExplicitIndirectVariableFixer;
use PhpCsFixer\Fixer\LanguageConstruct\FunctionToConstantFixer;
use PhpCsFixer\Fixer\Operator\NewWithBracesFixer;
use PhpCsFixer\Fixer\Operator\StandardizeIncrementFixer;
use PhpCsFixer\Fixer\PhpUnit\PhpUnitMethodCasingFixer;
use PhpCsFixer\Fixer\StringNotation\ExplicitStringVariableFixer;
use PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer;
use Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
return static function (ECSConfig $ecsConfig): void {
$ecsConfig->paths([__DIR__ . '/src']);
$ecsConfig->rule(YodaStyleFixer::class);
$ecsConfig->rules([
PhpUnitMethodCasingFixer::class,
FunctionToConstantFixer::class,
ExplicitStringVariableFixer::class,
ExplicitIndirectVariableFixer::class,
NewWithBracesFixer::class,
StandardizeIncrementFixer::class,
SelfAccessorFixer::class,
MagicConstantCasingFixer::class,
NoUselessElseFixer::class,
SingleQuoteFixer::class,
OrderedClassElementsFixer::class,
]);
$ecsConfig->ruleWithConfiguration(SingleClassElementPerStatementFixer::class, ['elements' => ['const', 'property']]);
$ecsConfig->ruleWithConfiguration(ClassDefinitionFixer::class, ['single_line' => \true]);
$ecsConfig->sets([
SetList::PSR_12,
SetList::SPACES,
SetList::DOCBLOCK,
SetList::COMMENTS,
SetList::PHPUNIT,
SetList::NAMESPACES,
SetList::CLEAN_CODE,
SetList::ARRAY,
]);
};