-
Notifications
You must be signed in to change notification settings - Fork 0
/
.phpinsights
108 lines (99 loc) · 4.46 KB
/
.phpinsights
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
<?php
declare(strict_types=1);
use NunoMaduro\PhpInsights\Domain\Insights\ForbiddenTraits;
use NunoMaduro\PhpInsights\Domain\Metrics\Architecture\Classes;
use NunoMaduro\PhpInsights\Domain\Insights\ForbiddenFinalClasses;
use NunoMaduro\PhpInsights\Domain\Insights\ForbiddenNormalClasses;
use NunoMaduro\PhpInsights\Domain\Insights\ForbiddenPrivateMethods;
use NunoMaduro\PhpInsights\Domain\Insights\ForbiddenDefineFunctions;
use SlevomatCodingStandard\Sniffs\TypeHints\DeclareStrictTypesSniff;
use SlevomatCodingStandard\Sniffs\TypeHints\TypeHintDeclarationSniff;
use SlevomatCodingStandard\Sniffs\TypeHints\DisallowMixedTypeHintSniff;
use SlevomatCodingStandard\Sniffs\Namespaces\AlphabeticallySortedUsesSniff;
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", "magento2", "drupal"
|
*/
'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'=>[
// 'path/to/directory-or-file'
'.idea',
'.data',
'build',
'vendor',
],
'add'=>[
Classes::class=>[
ForbiddenFinalClasses::class,
SlevomatCodingStandard\Sniffs\ControlStructures\DisallowYodaComparisonSniff::class,
PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\DisallowAlternativePHPTagsSniff::class,
],
],
'remove'=>[
AlphabeticallySortedUsesSniff::class,
DeclareStrictTypesSniff::class,
DisallowMixedTypeHintSniff::class,
ForbiddenDefineFunctions::class,
ForbiddenNormalClasses::class,
ForbiddenTraits::class,
TypeHintDeclarationSniff::class,
ObjectCalisthenics\Sniffs\Classes\ForbiddenPublicPropertySniff::class,
SlevomatCodingStandard\Sniffs\Commenting\EmptyCommentSniff::class,
SlevomatCodingStandard\Sniffs\Namespaces\UseFromSameNamespaceSniff::class,
SlevomatCodingStandard\Sniffs\Functions\UnusedParameterSniff::class,
SlevomatCodingStandard\Sniffs\ControlStructures\DisallowEmptySniff::class,
SlevomatCodingStandard\Sniffs\Classes\ClassConstantVisibilitySniff::class,
SlevomatCodingStandard\Sniffs\Classes\SuperfluousTraitNamingSniff::class,
PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterNotSniff::class,
PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes\ClassDeclarationSniff::class,
PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\UselessOverridingMethodSniff::class,
PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterCastSniff::class,
PHP_CodeSniffer\Standards\PSR1\Sniffs\Files\SideEffectsSniff::class,
],
'config'=>[
ForbiddenPrivateMethods::class=>[
'title'=>'The usage of private methods is not idiomatic in Laravel.',
],
\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class=>[
'lineLimit'=>120,
'absoluteLineLimit'=>140,
'ignoreComments'=>false,
],
\ObjectCalisthenics\Sniffs\Files\FunctionLengthSniff::class=>[
'maxLength'=>50,
],
\ObjectCalisthenics\Sniffs\Metrics\MaxNestingLevelSniff::class=>[
'maxNestingLevel'=>3,
],
\NunoMaduro\PhpInsights\Domain\Insights\CyclomaticComplexityIsHigh::class=>[
'maxComplexity' => 15,
],
\SlevomatCodingStandard\Sniffs\Commenting\DocCommentSpacingSniff::class => [
'linesCountBeforeFirstContent' => 0,
'linesCountBetweenDescriptionAndAnnotations' => 1,
'linesCountBetweenDifferentAnnotationsTypes' => 1,
'linesCountBetweenAnnotationsGroups' => 1,
'linesCountAfterLastContent' => 0,
'annotationsGroups' => [],
]
],
];