-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathphpstan.neon
74 lines (64 loc) · 2.38 KB
/
phpstan.neon
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
#
# Tip: use \PHPStan\dumpType($a); to debug types
#
parameters:
level: 8
paths:
- '%currentWorkingDirectory%/src'
parallel:
processTimeout: 1000.0 # If this is not enough, allocate more cores to docker
compact:
format: "src/{path}:{line} {error}"
strictRules:
disallowedLooseComparison: false
booleansInConditions: false
uselessCast: false
requireParentConstructorCall: true
disallowedConstructs: true
overwriteVariablesWithLoop: true
closureUsesThis: true
matchingInheritedMethodNames: true
numericOperandsInArithmeticOperators: false
strictCalls: true
switchConditionsMatchingType: true
noVariableVariables: false
# See https://github.com/phpstan/phpstan-src/blob/0.12.56/conf/config.neon#L21-L44
checkUninitializedProperties: true
checkMissingIterableValueType: false
# https://github.com/phpstan/phpstan-strict-rules/blob/0.12.2/rules.neon
checkAlwaysTrueCheckTypeFunctionCall: true
checkAlwaysTrueInstanceof: true
checkExplicitMixedMissingReturn: false
checkFunctionNameCase: true
reportMaybesInMethodSignatures: false
reportStaticMethodSignatures: true
checkGenericClassInNonGenericObjectType: false
reportWrongPhpDocTypeInVarTag: false
banned_code:
# enable detection of `use Tests\Foo\Bar` in a non-test file
use_from_tests: true
nodes:
-
type: Expr_FuncCall
functions:
- Functional\filter # Please use F\select instead
- Functional\each # Please use the native foreach
- Functional\partition # Please use foreach instead
conditionalTags:
PHPStan\Rules\DisallowedConstructs\DisallowedShortTernaryRule:
phpstan.rules.rule: false
includes:
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
- vendor/grifart/phpstan-oneline/config.neon
- vendor/ekino/phpstan-banned-code/extension.neon
- vendor/phpstan/phpstan-strict-rules/rules.neon
services:
- class: PHPStan\Rules\Cast\UselessCastRule
arguments:
treatPhpDocTypesAsCertain: %treatPhpDocTypesAsCertain%
tags:
- phpstan.rules.rule
errorFormatter.table:
arguments:
relativePathHelper: @simpleRelativePathHelper