-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpinsights.php
76 lines (71 loc) · 3.58 KB
/
phpinsights.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
<?php
declare(strict_types=1);
return [
'preset' => 'default',
'exclude' => [
],
'add' => [
NunoMaduro\PhpInsights\Domain\Metrics\Code\Code::class => [
// Code
SlevomatCodingStandard\Sniffs\ControlStructures\RequireYodaComparisonSniff::class,
],
],
'remove' => [
// Code
NunoMaduro\PhpInsights\Domain\Insights\ForbiddenGlobals::class,
SlevomatCodingStandard\Sniffs\Classes\ForbiddenPublicPropertySniff::class,
NunoMaduro\PhpInsights\Domain\Sniffs\ForbiddenSetterSniff::class,
PhpCsFixer\Fixer\ControlStructure\NoUnneededControlParenthesesFixer::class,
PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\UselessOverridingMethodSniff::class,
SlevomatCodingStandard\Sniffs\Commenting\UselessInheritDocCommentSniff::class,
SlevomatCodingStandard\Sniffs\ControlStructures\DisallowYodaComparisonSniff::class,
SlevomatCodingStandard\Sniffs\ControlStructures\LanguageConstructWithParenthesesSniff::class,
SlevomatCodingStandard\Sniffs\Functions\StaticClosureSniff::class,
SlevomatCodingStandard\Sniffs\PHP\UselessParenthesesSniff::class,
SlevomatCodingStandard\Sniffs\TypeHints\DisallowArrayTypeHintSyntaxSniff::class,
SlevomatCodingStandard\Sniffs\TypeHints\ParameterTypeHintSniff::class,
SlevomatCodingStandard\Sniffs\TypeHints\PropertyTypeHintSniff::class,
SlevomatCodingStandard\Sniffs\TypeHints\ReturnTypeHintSniff::class,
// Architecture
NunoMaduro\PhpInsights\Domain\Insights\ForbiddenNormalClasses::class,
NunoMaduro\PhpInsights\Domain\Insights\ForbiddenTraits::class,
SlevomatCodingStandard\Sniffs\Classes\SuperfluousExceptionNamingSniff::class,
// Style
PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ArbitraryParenthesesSpacingSniff::class,
],
'config' => [
// Architecture
SlevomatCodingStandard\Sniffs\Functions\FunctionLengthSniff::class => [
'maxLinesLength' => 32,
],
// Style
PhpCsFixer\Fixer\Basic\BracesFixer::class => [
'allow_single_line_closure' => false,
'position_after_anonymous_constructs' => 'same',
'position_after_control_structures' => 'next',
'position_after_functions_and_oop_constructs' => 'next',
],
PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer::class => [
'operators' => [
'=>' => 'align_single_space',
],
'default' => 'single_space', // default fix strategy: possibles values ['align', 'align_single_space', 'align_single_space_minimal', 'single_space', 'no_space', null]
],
PhpCsFixer\Fixer\Whitespace\NoExtraBlankLinesFixer::class => [
'tokens' => [], // possibles values ['break', 'case', 'continue', 'curly_brace_block', 'default', 'extra', 'parenthesis_brace_block', 'return', 'square_brace_block', 'switch', 'throw', 'use', 'use_trait']
],
PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class => [
'lineLimit' => 120,
'absoluteLineLimit' => 120,
'ignoreComments' => true,
],
SlevomatCodingStandard\Sniffs\Commenting\DocCommentSpacingSniff::class => [
'linesCountBeforeFirstContent' => 0,
'linesCountBetweenDescriptionAndAnnotations' => 1,
'linesCountBetweenDifferentAnnotationsTypes' => 0,
'linesCountBetweenAnnotationsGroups' => 0,
'linesCountAfterLastContent' => 0,
'annotationsGroups' => [],
],
],
];