forked from systemsdk/docker-nginx-php-laravel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpinsights.php
125 lines (122 loc) · 5.37 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
<?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' => 'laravel',
/*
|--------------------------------------------------------------------------
| 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' => [
'bootstrap',
'config',
'database',
'docker',
'docs',
'public',
'reports',
'resources',
'routes',
'storage',
'tests',
'tools',
'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,
SlevomatCodingStandard\Sniffs\ControlStructures\DisallowEmptySniff::class,
PHP_CodeSniffer\Standards\Generic\Sniffs\Commenting\TodoSniff::class,
SlevomatCodingStandard\Sniffs\ControlStructures\DisallowShortTernaryOperatorSniff::class,
],
'config' => [
SlevomatCodingStandard\Sniffs\Functions\FunctionLengthSniff::class => [
'maxLinesLength' => 45,
],
PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class => [
'lineLimit' => 120,
'absoluteLineLimit' => 140,
'ignoreComments' => true,
],
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' => [
'app/Exceptions/Handler.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,
],
],
];