-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecs.php
81 lines (76 loc) · 4.38 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 Symplify\EasyCodingStandard\Config\ECSConfig;
use Symplify\EasyCodingStandard\ValueObject\Set\SetList;
return static function (ECSConfig $ecsConfig): void {
$ecsConfig->paths([
__DIR__ . '/src',
__DIR__ . '/tests',
]);
// this way you add a single rule
$ecsConfig->rules([
\PhpCsFixer\Fixer\Operator\LogicalOperatorsFixer::class,
\PhpCsFixer\Fixer\Comment\MultilineCommentOpeningClosingFixer::class,
\PhpCsFixer\Fixer\Comment\SingleLineCommentStyleFixer::class,
\PhpCsFixer\Fixer\ClassNotation\NoNullPropertyInitializationFixer::class,
\PhpCsFixer\Fixer\FunctionNotation\MethodArgumentSpaceFixer::class,
\PhpCsFixer\Fixer\StringNotation\ExplicitStringVariableFixer::class,
\PhpCsFixer\Fixer\StringNotation\SimpleToComplexStringVariableFixer::class,
\PhpCsFixer\Fixer\Phpdoc\PhpdocOrderFixer::class,
\PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer::class,
\PhpCsFixer\Fixer\Whitespace\ArrayIndentationFixer::class,
\PhpCsFixer\Fixer\ReturnNotation\ReturnAssignmentFixer::class,
\PhpCsFixer\Fixer\ControlStructure\TrailingCommaInMultilineFixer::class,
\PhpCsFixer\Fixer\ArrayNotation\WhitespaceAfterCommaInArrayFixer::class,
\PhpCsFixer\Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer::class,
\PhpCsFixer\Fixer\Phpdoc\NoBlankLinesAfterPhpdocFixer::class,
\PhpCsFixer\Fixer\Casing\ConstantCaseFixer::class,
\PhpCsFixer\Fixer\ClassNotation\ClassDefinitionFixer::class,
\PhpCsFixer\Fixer\Import\NoUnusedImportsFixer::class,
\PhpCsFixer\Fixer\FunctionNotation\ReturnTypeDeclarationFixer::class,
\PhpCsFixer\Fixer\Phpdoc\PhpdocNoUselessInheritdocFixer::class,
\PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer::class,
\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class,
\PhpCsFixer\Fixer\CastNotation\NoShortBoolCastFixer::class,
\PhpCsFixer\Fixer\Phpdoc\PhpdocIndentFixer::class,
\PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer::class,
\PhpCsFixer\Fixer\Whitespace\NoWhitespaceInBlankLineFixer::class,
\PhpCsFixer\Fixer\Whitespace\BlankLineBeforeStatementFixer::class,
\PhpCsFixer\Fixer\Phpdoc\PhpdocSingleLineVarSpacingFixer::class,
\PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer::class,
\PhpCsFixer\Fixer\Basic\BracesFixer::class,
\PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer::class,
\PhpCsFixer\Fixer\ClassNotation\SingleClassElementPerStatementFixer::class,
\PhpCsFixer\Fixer\Phpdoc\NoSuperfluousPhpdocTagsFixer::class,
\PhpCsFixer\Fixer\Phpdoc\PhpdocTypesOrderFixer::class,
\PhpCsFixer\Fixer\Import\OrderedImportsFixer::class,
\PhpCsFixer\Fixer\CastNotation\CastSpacesFixer::class,
\PhpCsFixer\Fixer\Strict\DeclareStrictTypesFixer::class,
]);
$ecsConfig->skip([
\PhpCsFixer\Fixer\Whitespace\BlankLineBetweenImportGroupsFixer::class,
\PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer::class,
\PhpCsFixer\Fixer\Operator\ConcatSpaceFixer::class,
\PhpCsFixer\Fixer\Phpdoc\PhpdocToCommentFixer::class,
\PhpCsFixer\Fixer\StringNotation\HeredocToNowdocFixer::class,
\PhpCsFixer\Fixer\Whitespace\HeredocIndentationFixer::class,
\PhpCsFixer\Fixer\Phpdoc\PhpdocAddMissingParamAnnotationFixer::class,
\PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer::class => false,
\PhpCsFixer\Fixer\ClassNotation\SingleTraitInsertPerStatementFixer::class,
\PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer::class,
\PhpCsFixer\Fixer\FunctionNotation\SingleLineThrowFixer::class,
\PhpCsFixer\Fixer\Phpdoc\PhpdocSeparationFixer::class,
\PhpCsFixer\Fixer\ClassNotation\NoBlankLinesAfterClassOpeningFixer::class,
\PhpCsFixer\Fixer\Phpdoc\PhpdocSummaryFixer::class,
\PhpCsFixer\Fixer\Operator\IncrementStyleFixer::class,
\PhpCsFixer\Fixer\Phpdoc\PhpdocVarWithoutNameFixer::class,
\PhpCsFixer\Fixer\PhpUnit\PhpUnitInternalClassFixer::class,
\PhpCsFixer\Fixer\PhpUnit\PhpUnitTestClassRequiresCoversFixer::class,
\PhpCsFixer\Fixer\Semicolon\MultilineWhitespaceBeforeSemicolonsFixer::class,
]);
// this way you can add sets - group of rules
$ecsConfig->sets([
SetList::PSR_12,
SetList::DOCTRINE_ANNOTATIONS,
]);
};