-
Notifications
You must be signed in to change notification settings - Fork 5
/
easy-coding-standard.neon
66 lines (55 loc) · 2.63 KB
/
easy-coding-standard.neon
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
includes:
- vendor/sylius-labs/coding-standard/easy-coding-standard.neon
- vendor/symplify/easy-coding-standard/config/php_codesniffer/psr2.neon
- vendor/symplify/easy-coding-standard/config/php_cs_fixer/psr2.neon
checkers:
# All rules with default values
# Rule 1: Only X indentation level per function/method (with default values)
ObjectCalisthenics\Sniffs\Metrics\MaxNestingLevelSniff:
maxNestingLevel: 2
# Rule 2: There is no "else"
- ObjectCalisthenics\Sniffs\ControlStructures\NoElseSniff
# Rule 5: Only one object operator (->) per line (with default values)
ObjectCalisthenics\Sniffs\CodeAnalysis\OneObjectOperatorPerLineSniff:
variablesHoldingAFluentInterface: ["$queryBuilder", "$containerBuilder"]
methodsStartingAFluentInterface: ["createQueryBuilder"]
methodsEndingAFluentInterface: ["execute", "getQuery"]
# Rule 6: Do not abbreviate (with default values)
ObjectCalisthenics\Sniffs\NamingConventions\ElementNameMinimalLengthSniff:
minLength: 3
allowedShortNames: ["i", "id", "Id", "to", "up"]
# Rule 7: Keep your classes small (with default values)
ObjectCalisthenics\Sniffs\Files\ClassTraitAndInterfaceLengthSniff:
maxLength: 200
ObjectCalisthenics\Sniffs\Files\FunctionLengthSniff:
maxLength: 21
ObjectCalisthenics\Sniffs\Metrics\PropertyPerClassLimitSniff:
maxCount: 10
ObjectCalisthenics\Sniffs\Metrics\MethodPerClassLimitSniff:
maxCount: 10
# Rule 9: Do not Use Getters and Setters
- ObjectCalisthenics\Sniffs\Classes\ForbiddenPublicPropertySniff
- ObjectCalisthenics\Sniffs\NamingConventions\NoSetterSniff
PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer:
equal: false
identical: false
less_and_greater: false
# Metrics
PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff:
absoluteLineLimit: 120
PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\CyclomaticComplexitySniff:
absoluteComplexity: 4
PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\NestingLevelSniff:
absoluteNestingLevel: 2
parameters:
skip:
SlevomatCodingStandard\Sniffs\TypeHints\TypeHintDeclarationSniff:
- *Behat/Context/*/*Context.php
exclude_checkers:
# Symfony ruleset
- PhpCsFixer\Fixer\PhpTag\BlankLineAfterOpeningTagFixer
- PhpCsFixer\Fixer\Operator\NewWithBracesFixer
- PhpCsFixer\Fixer\Phpdoc\PhpdocAlignFixer
# mutually excluded
- SlevomatCodingStandard\Sniffs\ControlStructures\DisallowYodaComparisonSniff
- PhpCsFixer\Fixer\Operator\UnaryOperatorSpacesFixer