-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpinsights.php
59 lines (50 loc) · 2.53 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
<?php
return [
// phpinsights.php
'preset' => 'laravel',
'ide' => 'phpstorm',
'exclude' => [
'app/Providers'
],
'add' => [],
'remove' => [
// Code
\SlevomatCodingStandard\Sniffs\TypeHints\DeclareStrictTypesSniff::class, // Declare strict types
\SlevomatCodingStandard\Sniffs\Classes\ForbiddenPublicPropertySniff::class, // Forbidden public property
\PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class, // Visibility required
\SlevomatCodingStandard\Sniffs\Classes\ClassConstantVisibilitySniff::class, // Class constant visibility
\SlevomatCodingStandard\Sniffs\ControlStructures\DisallowEmptySniff::class, // Disallow empty
\PhpCsFixer\Fixer\Comment\NoEmptyCommentFixer::class, // No empty comment
\SlevomatCodingStandard\Sniffs\Commenting\UselessFunctionDocCommentSniff::class, // Useless function doc comment
// Architecture
\NunoMaduro\PhpInsights\Domain\Insights\ForbiddenNormalClasses::class, //Normal classes are forbidden
// Style
\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterCastSniff::class, // Space after cast
\PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterNotSniff::class, // Space after not
\SlevomatCodingStandard\Sniffs\Namespaces\AlphabeticallySortedUsesSniff::class, // Alphabetically sorted uses
\SlevomatCodingStandard\Sniffs\Commenting\DocCommentSpacingSniff::class, // Doc comment spacing
\PhpCsFixer\Fixer\ClassNotation\OrderedClassElementsFixer::class, // Ordered class elements
\PhpCsFixer\Fixer\StringNotation\SingleQuoteFixer::class, // Single quote
],
'config' => [
\NunoMaduro\PhpInsights\Domain\Insights\CyclomaticComplexityIsHigh::class => [
'maxComplexity' => 8,
],
\PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff::class => [
'lineLimit' => 120,
'absoluteLineLimit' => 120,
'ignoreComments' => false,
],
\PhpCsFixer\Fixer\Import\OrderedImportsFixer::class => [
'imports_order' => ['class', 'const', 'function'],
'sort_algorithm' => 'length',
]
],
'requirements' => [
'min-quality' => 75,
'min-complexity' => 75,
'min-architecture' => 75,
'min-style' => 75,
'disable-security-check' => false,
],
];