-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathphpstan.extension.neon
More file actions
61 lines (57 loc) · 2.69 KB
/
phpstan.extension.neon
File metadata and controls
61 lines (57 loc) · 2.69 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
includes:
- %currentWorkingDirectory%/vendor/ekino/phpstan-banned-code/extension.neon
- %currentWorkingDirectory%/vendor/phpstan/phpstan-phpunit/extension.neon
- %currentWorkingDirectory%/vendor/phpstan/phpstan-webmozart-assert/extension.neon
# Some rule sets must be included here as they also define default parameters
- %currentWorkingDirectory%/vendor/shipmonk/phpstan-rules/rules.neon
- %currentWorkingDirectory%/vendor/phpstan/phpstan-phpunit/rules.neon
- %currentWorkingDirectory%/vendor/phpstan/phpstan-strict-rules/rules.neon
- %currentWorkingDirectory%/vendor/roave/no-floaters/rules.neon
#- %currentWorkingDirectory%/vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon
rules:
- AssoConnect\PHPStanRules\Rules\DateTimeMustNotBeUsedRule
- AssoConnect\PHPStanRules\Rules\EnforceHttpsLinksInPhpDocRule
- AssoConnect\PHPStanRules\Rules\EnforceHttpsLinksInStringScalarRule
#- AssoConnect\PHPStanRules\Rules\ForbidIdenticalClassComparisonRule (defined as a service)
- Ergebnis\PHPStan\Rules\Files\DeclareStrictTypesRule
parametersSchema:
forbidIdenticalClassComparison: structure([
allowList: arrayOf(string())
])
services:
-
class: AssoConnect\PHPStanRules\Rules\ForbidIdenticalClassComparisonRule
tags:
- phpstan.rules.rule
arguments:
allowList: %forbidIdenticalClassComparison.allowList%
parameters:
level: 8
# Stricter setup
checkMissingCallableSignature: true
checkTooWideReturnTypesInProtectedAndPublicMethods: true
checkUninitializedProperties: true
forbidIdenticalClassComparison:
allowList: []
shipmonkRules:
forbidFetchOnMixed:
enabled: false # Too many false positive
forbidIdenticalClassComparison:
enabled: true # Replaced by our own rule with an allow list
forbidMethodCallOnMixed:
enabled: false # Too many false positive
forbidNullInBinaryOperations:
enabled: false # Too many false positive
blacklist: [
'**', '!=', '==', '+', 'and', 'or', '&&', '||', '%', '-', '/', '*', # checked by phpstan-strict-rules
'>', '>=', '<', '<=', '<=>', # checked by AllowComparingOnlyComparableTypesRule
'===', '!==', '??' # valid with null involved
]
banned_code:
non_ignorable: false
ignoreErrors:
-
# Prevents using @return mixed[] for all test providers
message: '#Method [a-zA-Z0-9\\_]+::provide[a-zA-Z]+\(\) return type has no value type specified in iterable type iterable.#'
path: %currentWorkingDirectory%/tests/
reportUnmatched: false