-
-
Notifications
You must be signed in to change notification settings - Fork 514
Expand file tree
/
Copy pathphpstan.neon.dist
More file actions
75 lines (61 loc) · 3.14 KB
/
phpstan.neon.dist
File metadata and controls
75 lines (61 loc) · 3.14 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
includes:
- phpstan-baseline.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
parameters:
level: 5
paths:
- benchmark
- src
- tests
excludePaths:
- tests/Tests/Mapping/Driver/fixtures/User.php
- tests/Hydrators/
- tests/PersistentCollections/ (?)
- tests/Proxies/
treatPhpDocTypesAsCertain: false
ignoreErrors:
# Ignore typing providers in tests
- '#^Method Doctrine\\ODM\\MongoDB\\Tests\\[^:]+(Test)::(get\w+|data\w+|provide\w+)\(\) return type has no value type specified in iterable type (array|iterable)\.#'
# Ignore circular references in Psalm types
- message: '#^Circular definition detected in type alias#'
path: src/Aggregation/
# Keep type assertions even when type is declared
- identifier: staticMethod.alreadyNarrowedType
path: tests/Tests/
- message: '#generic class Doctrine\\ODM\\MongoDB\\(Mapping\\ClassMetadata|Persisters\\DocumentPersister) (but )?does not specify its types\: T$#'
identifier: missingType.generics
- message: '#^(Constant|Used constant) DOCTRINE_MONGODB_DATABASE not found\.$#'
identifier: constant.notFound
path: tests/
# Unused properties from test document classes
- message: '#^Property (DoctrineGlobal_|Documents\\|Doctrine\\ODM\\MongoDB\\Tests\\)[^:]+(?<!Test)::\$[a-zA-Z0-9_]+ is unused\.$#'
identifier: property.unused
path: tests/
- message: '#^Property (DoctrineGlobal_|Documents\\|Doctrine\\ODM\\MongoDB\\Tests\\)[^:]+(?<!Test)::\$[a-zA-Z0-9_]+ is never written, only read\.$#'
identifier: property.onlyRead
path: tests/
- message: '#^Property (DoctrineGlobal_|Documents\\|Doctrine\\ODM\\MongoDB\\Tests\\)[^:]+(?<!Test)::\$[a-zA-Z0-9_]+ is never read, only written\.$#'
identifier: property.onlyWritten
path: tests/
- message: '#^Property (DoctrineGlobal_|Documents\\|Doctrine\\ODM\\MongoDB\\Tests\\)[^:]+(?<!Test)::\$[a-zA-Z0-9_]+ \(.*\) is never assigned .* so it can be removed from the property type\.$#'
identifier: property.unusedType
path: tests/
# Requires ext-mongodb 2.2+
- message: '#MongoDB\\BSON\\VectorType#'
- message: '#MongoDB\\BSON\\Binary\:\:(TYPE_VECTOR|getVectorType|toArray|fromVector)#'
- message: '#^Class Doctrine\\ODM\\MongoDB\\Mapping\\([a-zA-Z0-9\\]+) extends @final class Doctrine\\ODM\\MongoDB\\Mapping\\Attribute\\([a-zA-Z0-9\\]+)\.$#'
identifier: class.extendsFinalByPhpDoc
path: src/Mapping/Annotations/
# To be removed when reaching phpstan level 6
checkMissingVarTagTypehint: true
checkMissingTypehints: true
# Disabled due to inconsistent errors upon encountering psalm types
reportUnmatchedIgnoredErrors: false
# To be removed when reaching phpstan level 6
rules:
- PHPStan\Rules\Constants\MissingClassConstantTypehintRule
- PHPStan\Rules\Functions\MissingFunctionParameterTypehintRule
- PHPStan\Rules\Functions\MissingFunctionReturnTypehintRule
- PHPStan\Rules\Methods\MissingMethodParameterTypehintRule
- PHPStan\Rules\Methods\MissingMethodReturnTypehintRule
- PHPStan\Rules\Properties\MissingPropertyTypehintRule