-
Notifications
You must be signed in to change notification settings - Fork 17
/
phpinsights.php
151 lines (148 loc) · 7.32 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?php
declare(strict_types=1);
/** @noinspection PhpUndefinedNamespaceInspection */
/** @noinspection PhpUndefinedClassInspection */
return [
/*
|--------------------------------------------------------------------------
| Default Preset
|--------------------------------------------------------------------------
|
| This option controls the default preset that will be used by PHP Insights
| to make your code reliable, simple, and clean. However, you can always
| adjust the `Metrics` and `Insights` below in this configuration file.
|
| Supported: "default", "laravel", "symfony"
|
*/
'preset' => 'symfony',
/*
|--------------------------------------------------------------------------
| Configuration
|--------------------------------------------------------------------------
|
| Here you may adjust all the various `Insights` that will be used by PHP
| Insights. You can either add, remove or configure `Insights`. Keep in
| mind, that all added `Insights` must belong to a specific `Metric`.
|
*/
'exclude' => [
'bin',
'config',
'docker',
'docs',
'public',
'reports',
'migrations',
'templates',
'tests',
'tools',
'translations',
'var',
'vendor',
],
'add' => [
],
'remove' => [
// ExampleInsight::class,
NunoMaduro\PhpInsights\Domain\Insights\Composer\ComposerMustBeValid::class,
NunoMaduro\PhpInsights\Domain\Insights\ForbiddenNormalClasses::class,
NunoMaduro\PhpInsights\Domain\Insights\ForbiddenTraits::class,
NunoMaduro\PhpInsights\Domain\Sniffs\ForbiddenSetterSniff::class,
ObjectCalisthenics\Sniffs\Classes\ForbiddenPublicPropertySniff::class,
ObjectCalisthenics\Sniffs\NamingConventions\NoSetterSniff::class,
PhpCsFixer\Fixer\ArrayNotation\NoMultilineWhitespaceAroundDoubleArrowFixer::class,
SlevomatCodingStandard\Sniffs\Classes\SuperfluousExceptionNamingSniff::class,
SlevomatCodingStandard\Sniffs\Classes\SuperfluousInterfaceNamingSniff::class,
SlevomatCodingStandard\Sniffs\Classes\SuperfluousTraitNamingSniff::class,
SlevomatCodingStandard\Sniffs\Classes\ForbiddenPublicPropertySniff::class,
SlevomatCodingStandard\Sniffs\Commenting\DocCommentSpacingSniff::class,
SlevomatCodingStandard\Sniffs\Commenting\InlineDocCommentDeclarationSniff::class,
SlevomatCodingStandard\Sniffs\Commenting\UselessInheritDocCommentSniff ::class,
SlevomatCodingStandard\Sniffs\Commenting\UselessFunctionDocCommentSniff::class,
SlevomatCodingStandard\Sniffs\TypeHints\DeclareStrictTypesSniff::class,
SlevomatCodingStandard\Sniffs\TypeHints\DisallowMixedTypeHintSniff::class,
SlevomatCodingStandard\Sniffs\TypeHints\DisallowArrayTypeHintSyntaxSniff::class,
SlevomatCodingStandard\Sniffs\TypeHints\ParameterTypeHintSniff::class,
SlevomatCodingStandard\Sniffs\TypeHints\PropertyTypeHintSniff::class,
SlevomatCodingStandard\Sniffs\TypeHints\ReturnTypeHintSniff::class,
PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\TodoSniff::class,
],
'config' => [
SlevomatCodingStandard\Sniffs\Functions\FunctionLengthSniff::class => [
'maxLinesLength' => 50,
],
PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class => [
'lineLimit' => 120,
'absoluteLineLimit' => 140,
'ignoreComments' => true,
'exclude' => [
'src/General/Application/Rest/Interfaces/RestResourceInterface.php',
],
],
PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterCastSniff::class => [
'spacing' => 0,
],
PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterNotSniff::class => [
'spacing' => 0,
],
PhpCsFixer\Fixer\CastNotation\CastSpacesFixer::class => [
'space' => 'none', // possible values ['single', 'none'],
],
PhpCsFixer\Fixer\Import\OrderedImportsFixer::class => [
'imports_order' => ['class', 'function', 'const'],
'sort_algorithm' => 'alpha', // possible values ['alpha', 'length', 'none']
],
PhpCsFixer\Fixer\LanguageConstruct\DeclareEqualNormalizeFixer::class => [
'space' => 'none', // possible values ['none', 'single']
],
PhpCsFixer\Fixer\Operator\BinaryOperatorSpacesFixer::class => [
'operators' => [
'&' => 'align',
],
],
SlevomatCodingStandard\Sniffs\Functions\UnusedParameterSniff::class => [
'exclude' => [
'src/General/Transport/ValueResolver/LoggedInUserValueResolver.php',
'src/General/Transport/ValueResolver/RestDtoValueResolver.php',
'src/General/Transport/AutoMapper/RestRequestMapper.php',
'src/General/Application/Decorator/StopwatchDecorator.php',
'src/General/Domain/Doctrine/DBAL/Types/EnumType.php',
'src/General/Transport/Rest/Traits/Methods/RestMethodProcessCriteria.php',
'src/General/Application/Rest/Traits/RestResourceCount.php',
'src/General/Application/Rest/Traits/RestResourceCreate.php',
'src/General/Application/Rest/Traits/RestResourceDelete.php',
'src/General/Application/Rest/Traits/RestResourceFind.php',
'src/General/Application/Rest/Traits/RestResourceFindOne.php',
'src/General/Application/Rest/Traits/RestResourceFindOneBy.php',
'src/General/Application/Rest/Traits/RestResourceIds.php',
'src/General/Application/Rest/Traits/RestResourcePatch.php',
'src/General/Application/Rest/Traits/RestResourceSave.php',
'src/General/Application/Rest/Traits/RestResourceUpdate.php',
'src/ApiKey/Application/Security/Authenticator/ApiKeyAuthenticator.php',
'src/User/Application/Security/Handler/TranslatedAuthenticationFailureHandler.php',
'src/ApiKey/Application/Security/Provider/ApiKeyUserProvider.php',
'src/User/Application/Security/Voter/IsUserHimselfVoter.php',
'src/Tool/Application/Validator/Constraints/LanguageValidator.php',
'src/Tool/Application/Validator/Constraints/LocaleValidator.php',
'src/Tool/Application/Validator/Constraints/TimezoneValidator.php',
'src/User/Application/Validator/Constraints/UniqueEmailValidator.php',
'src/User/Application/Validator/Constraints/UniqueUsernameValidator.php',
'src/Tool/Transport/MessageHandler/TestHandler.php',
],
],
SlevomatCodingStandard\Sniffs\Namespaces\UnusedUsesSniff::class => [
'searchAnnotations' => true,
],
SlevomatCodingStandard\Sniffs\TypeHints\DeclareStrictTypesSniff::class => [
'linesCountBeforeDeclare' => 1,
'linesCountAfterDeclare' => 1,
'spacesCountAroundEqualsSign' => 1,
],
SlevomatCodingStandard\Sniffs\Namespaces\UseSpacingSniff::class => [
'linesCountBeforeFirstUse' => 1,
'linesCountBetweenUseTypes' => 1,
'linesCountAfterLastUse' => 1,
],
],
];