forked from zenstruck/foundry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpstan.neon
80 lines (64 loc) · 3.11 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
75
76
77
78
79
80
includes:
- phar://phpstan.phar/conf/bleedingEdge.neon
parameters:
level: 8
treatPhpDocTypesAsCertain: false
inferPrivatePropertyTypeFromConstructor: true
checkUninitializedProperties: true
checkMissingCallableSignature: true
paths:
- config
- src
- tests
- stubs/phpstan
banned_code:
non_ignorable: false
ignoreErrors:
# suppress strange behavior of PHPStan where it considers proxy() return type as *NEVER*
- message: '#Return type of call to function Zenstruck\\Foundry\\Persistence\\proxy contains unresolvable type#'
path: src/Persistence/ProxyRepositoryDecorator.php
# prevent PHPStan to force to type data providers
- identifier: missingType.iterableValue
path: tests/
# We support both PHPUnit versions (this method changed in PHPUnit 10)
- identifier: function.impossibleType
path: src/Test/Factories.php
# PHPStan does not understand PHP version checks
- message: '#Comparison operation "(<|>|<=|>=)" between int<80\d+, 80\d+> and 80\d+ is always (false|true).#'
# Hydrator and Factory are annotated @immutable
- identifier: property.readOnlyByPhpDocDefaultValue
paths:
- src/Object/Hydrator.php
- src/Factory.php
- src/ObjectFactory.php
- src/Persistence/PersistentObjectFactory.php
# Hydrator and Factory are annotated @immutable
- identifier: property.uninitializedReadonlyByPhpDoc
paths:
- src/Factory.php
- src/Persistence/PersistentObjectFactory.php
# Hydrator and Factory are annotated @immutable
- identifier: property.readOnlyByPhpDocAssignNotInConstructor
paths:
- src/Object/Hydrator.php
- src/Factory.php
- src/ObjectFactory.php
- src/Persistence/PersistentObjectFactory.php
# generics annotation are not so helpful in maker code
- identifier: missingType.generics
path: src/Maker/Factory/
# not relevant for factories generated by maker
- message: '#Method (.*)::defaults\(\) never returns callable(.*) so it can be removed from the return type.#'
path: tests/Fixture/Maker/expected/
# not relevant for factories generated by maker
- identifier: missingType.callable
path: tests/Fixture/Maker/expected/
excludePaths:
- tests/Fixture/Maker/expected/can_create_factory_with_auto_activated_not_persisted_option.php
- tests/Fixture/Maker/expected/can_create_factory_interactively.php
- tests/Fixture/Maker/expected/can_create_factory_with_embeddable_with_data_set_odm.php
- tests/Fixture/Maker/expected/can_create_factory_with_embeddable_with_data_set_orm.php
# phpstan runs with orm 3 - there are too many failures in these files which are compatible with orm 2
- ./src/Maker/Factory/LegacyORMDefaultPropertiesGuesser.php
- ./src/Maker/Factory/DoctrineScalarFieldsDefaultPropertiesGuesser.php
- ./src/ORM/OrmV2PersistenceStrategy.php