-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecs.yml
85 lines (61 loc) · 3.24 KB
/
ecs.yml
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
82
83
84
85
parameters:
indentation: " " # "spaces" by default, you can also use " " (2 spaces), " " (4 spaces) or " " (tab)
line_ending: "\n"
services:
PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer:
syntax: short
SlevomatCodingStandard\Sniffs\Variables\UnusedVariableSniff: ~
SlevomatCodingStandard\Sniffs\Variables\UselessVariableSniff: ~
# function ($var) use ($unused) { return $var; } → function ($var) { return $var; }
SlevomatCodingStandard\Sniffs\Functions\UnusedInheritedVariablePassedToClosureSniff: ~
# echo "hi";; → echo "hi";
SlevomatCodingStandard\Sniffs\PHP\UselessSemicolonSniff: ~
# ((new Class))->call() → (new Class)->call()
SlevomatCodingStandard\Sniffs\PHP\UselessParenthesesSniff: ~
# detect dead code
SlevomatCodingStandard\Sniffs\Classes\UnusedPrivateElementsSniff:
# drop dead use namespaces
PhpCsFixer\Fixer\Import\NoUnusedImportsFixer:
# and sort them A → Z
PhpCsFixer\Fixer\Import\OrderedImportsFixer:
# $value;;
PhpCsFixer\Fixer\Semicolon\NoEmptyStatementFixer:
# final class { ... protected ... }
PhpCsFixer\Fixer\ClassNotation\ProtectedToPrivateFixer:
# continue (2);
PhpCsFixer\Fixer\ControlStructure\NoUnneededControlParenthesesFixer:
# { echo 'hi'; }
PhpCsFixer\Fixer\ControlStructure\NoUnneededCurlyBracesFixer:
# $var = 5; return $var; → return $var;
PhpCsFixer\Fixer\ReturnNotation\ReturnAssignmentFixer:
# $var = $foo : $foo ? $bar → $var = $foo ?: $bar
SlevomatCodingStandard\Sniffs\ControlStructures\RequireShortTernaryOperatorSniff:
# $var = $var + foo → $var += $foo
SlevomatCodingStandard\Sniffs\Operators\RequireCombinedAssignmentOperatorSniff:
# null|Type → Type|null
SlevomatCodingStandard\Sniffs\TypeHints\NullTypeHintOnLastPositionSniff: ~
# remove empty spaces in phpdoc
PhpCsFixer\Fixer\Comment\NoTrailingWhitespaceInCommentFixer:
# trim 2+ empty lines in PhpDoc to 1
PhpCsFixer\Fixer\Phpdoc\PhpdocTrimConsecutiveBlankLineSeparationFixer: ~
# remove empty lines in phpdoc (be careful, can be buggy)
PhpCsFixer\Fixer\Phpdoc\PhpdocTrimFixer: ~
# remove empty phpdocs
Symplify\CodingStandard\Fixer\Commenting\RemoveEmptyDocBlockFixer: ~
# no empty doc blocks
PhpCsFixer\Fixer\Phpdoc\NoEmptyPhpdocFixer: ~
# @return null | @return void
PhpCsFixer\Fixer\Phpdoc\PhpdocNoEmptyReturnFixer: ~
# /** docblock */\n\t$code;
PhpCsFixer\Fixer\Phpdoc\PhpdocIndentFixer: ~
# /** boolean */
PhpCsFixer\Fixer\Phpdoc\PhpdocTypesFixer: ~
# SomeClass { ... /** @return SomeClass */ ... }
PhpCsFixer\Fixer\Phpdoc\PhpdocReturnSelfReferenceFixer: ~
imports:
#- { resource: '%vendor_dir%/symplify/easy-coding-standard/config/set/clean-code.yaml' }
#- { resource: '%vendor_dir%/symplify/easy-coding-standard/config/set/common/docblock.yaml' }
- { resource: '%vendor_dir%/symplify/easy-coding-standard/config/set/common/phpunit.yaml' }
- { resource: '%vendor_dir%/symplify/easy-coding-standard/config/set/common/strict.yaml' }
- { resource: '%vendor_dir%/symplify/easy-coding-standard/config/set/php71.yaml' }
- { resource: '%vendor_dir%/symplify/easy-coding-standard/config/set/psr12.yaml' }