Repository navigation
Expand file tree
/
Copy pathphpinsights-tests.php
More file actions
116 lines (113 loc) · 5.27 KB
/
Copy pathphpinsights-tests.php
File metadata and controls
116 lines (113 loc) · 5.27 KB
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
<?php
declare(strict_types=1);
use NunoMaduro\PhpInsights\Domain\Insights\CyclomaticComplexityIsHigh;
use NunoMaduro\PhpInsights\Domain\Insights\ForbiddenNormalClasses;
use PHP_CodeSniffer\Standards\Generic\Sniffs\CodeAnalysis\UselessOverridingMethodSniff;
use PHP_CodeSniffer\Standards\Generic\Sniffs\Files\LineLengthSniff;
use PHP_CodeSniffer\Standards\Generic\Sniffs\Formatting\SpaceAfterNotSniff;
use PHP_CodeSniffer\Standards\Generic\Sniffs\Strings\UnnecessaryStringConcatSniff;
use SlevomatCodingStandard\Sniffs\Classes\SuperfluousExceptionNamingSniff;
use SlevomatCodingStandard\Sniffs\Classes\SuperfluousInterfaceNamingSniff;
use SlevomatCodingStandard\Sniffs\Functions\FunctionLengthSniff;
use SlevomatCodingStandard\Sniffs\Functions\UnusedParameterSniff;
use SlevomatCodingStandard\Sniffs\Namespaces\UseSpacingSniff;
use SlevomatCodingStandard\Sniffs\TypeHints\DisallowMixedTypeHintSniff;
use SlevomatCodingStandard\Sniffs\TypeHints\ParameterTypeHintSniff;
use SlevomatCodingStandard\Sniffs\TypeHints\ReturnTypeHintSniff;
return [
'preset' => 'symfony',
'ide' => 'phpstorm',
'exclude' => [
'vendor',
'CLI/bats/php',
],
'add' => [],
'remove' => [
UnusedParameterSniff::class,
SuperfluousInterfaceNamingSniff::class,
SuperfluousExceptionNamingSniff::class,
SpaceAfterNotSniff::class,
NunoMaduro\PhpInsights\Domain\Sniffs\ForbiddenSetterSniff::class,
UseSpacingSniff::class,
],
'config' => [
ReturnTypeHintSniff::class => [
'exclude' => [
'src/User/Domain/Repository/UserRepositoryInterface',
],
],
ParameterTypeHintSniff::class => [
'exclude' => [
'tests/Unit/Shared/Infrastructure/Bus/CallableFirstParameterExtractorTest',
'tests/Unit/Shared/Infrastructure/Bus/Stub/HandlerWithoutTypeHint',
'tests/Behat/HealthCheckContext/HealthCheckContext.php',
],
],
DisallowMixedTypeHintSniff::class => [
'exclude' => [
'tests/Unit/Shared/Infrastructure/Bus/Event/Async/RecordingLogger.php',
],
],
LineLengthSniff::class => [
'exclude' => [
'phpinsights',
'tests/Behat/OAuthContext/OAuthContext.php',
'src/User/Infrastructure/Repository/MariaDBPasswordResetTokenRepository.php',
'tests/Integration/User/Infrastructure/Repository/CachePerformanceTest.php',
],
'ignoreComments' => true,
'lineLimit' => 100,
],
ForbiddenNormalClasses::class => [
'exclude' => [
'src/Shared/Infrastructure/Bus/Command/InMemorySymfonyCommandBus',
'src/Shared/Infrastructure/Bus/Event/InMemorySymfonyEventBus',
'src/Shared/OpenApi/Factory/Response/DuplicateEmailFactory',
'src/User/Domain/Entity/User',
],
],
UnnecessaryStringConcatSniff::class => [
'exclude' => [
'src/Shared/Application/OpenApi/Factory/Response/UnsupportedTypeFactory',
'src/User/Domain/Exception/DuplicateEmailException',
'src/Shared/Application/OpenApi/Factory/Response/DuplicateEmailFactory',
'src/Shared/Infrastructure/Bus/Command/CommandNotRegisteredException',
'src/Shared/Infrastructure/Bus/Event/EventNotRegisteredException.php',
'tests/Unit/Shared/Application/OpenApi/Factory/Response/OAuthRedirectResponseFactoryTest',
'tests/Unit/Shared/Application/OpenApi/Factory/Response/UnsupportedGrantTypeResponseFactoryTest',
'tests/Behat/OAuthContext/OAuthContext',
],
],
CyclomaticComplexityIsHigh::class => [
'exclude' => [
'src/Shared/Application/Validator/InitialsValidator.php',
'src/Shared/Application/Validator/PasswordValidator.php',
'tests/Unit/User/Infrastructure/Repository/CachedUserRepositoryTest.php',
'tests/Integration/User/Infrastructure/Repository/CachePerformanceTest.php',
],
],
FunctionLengthSniff::class => [
'exclude' => [
'tests/Unit/User/Infrastructure/Repository/CachedUserRepositoryTest.php',
'tests/Unit/User/Application/EventSubscriber/ConfirmationEmailSendEventSubscriberTest.php',
'tests/Unit/User/Application/EventSubscriber/EmailChangedEventSubscriberTest.php',
'tests/Unit/User/Application/EventSubscriber/UserRegisteredEventSubscriberTest.php',
],
],
UselessOverridingMethodSniff::class => [
'exclude' => [
'tests/Unit/Shared/Infrastructure/Bus/Event/Async/TestDomainEvent.php',
'tests/Unit/Shared/Infrastructure/Bus/Event/Async/TestEvent.php',
'tests/Unit/Shared/Infrastructure/Bus/Event/Async/TestOtherDomainEvent.php',
'tests/Unit/Shared/Infrastructure/Bus/Event/Async/ResilientAsyncEventBusTestEvent.php',
],
],
],
'requirements' => [
'min-quality' => 100,
'min-complexity' => 95,
'min-architecture' => 100,
'min-style' => 100,
],
'threads' => null,
];