forked from KnpLabs/DoctrineBehaviors
/
phpstan.neon
121 lines (96 loc) · 5.57 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
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
117
118
119
120
121
includes:
- phpstan-extension.neon
- vendor/symplify/phpstan-extensions/config/config.neon
- vendor/phpstan/phpstan-doctrine/extension.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/symplify/coding-standard/config/symplify-rules.neon
parameters:
paths:
- "src"
- "tests"
level: 8
checkGenericClassInNonGenericObjectType: false
# to allow installing with various phsptan versions without reporting old errors here
reportUnmatchedIgnoredErrors: false
ignoreErrors:
# traits
- '#Call to an undefined method Knp\\DoctrineBehaviors\\Contract\\Provider\\UserProviderInterface::changeUser\(\)#'
- '#Call to an undefined method Knp\\DoctrineBehaviors\\Contract\\Entity\\SluggableInterface::getId\(\)#'
- '#Call to an undefined method Knp\\DoctrineBehaviors\\Contract\\Entity\\TreeNodeInterface::getId\(\)#'
- '#Call to an undefined method Knp\\DoctrineBehaviors\\Contract\\Entity\\TreeNodeInterface::to(Flat)?Array\(\)#'
# buggy
- '#of function call_user_func_array expects callable#'
# mixed
- '#has no return typehint specified#'
- '#return type has no value type specified#'
- '#has parameter (.*?) with no (typehint|value type) specified#'
- '#Parameter \#1 \$input of function array_filter expects array, array<int, string\>\|false given#'
- '#PHPDoc tag @var for variable \$entity has invalid type Knp\\DoctrineBehaviors\\Model\\Uuidable\\UuidableTrait#'
# cache buggy
- '#Access to an undefined property Knp\\DoctrineBehaviors\\Tests\\Fixtures\\Entity\\TreeNodeEntity\:\:\$parentNodePath#'
- '#Property Knp\\DoctrineBehaviors\\Tests\\Fixtures\\Entity\\GeocodableEntity\:\:\$location has no typehint specified#'
# tests
- '#Offset 0 does not exist on array<Knp\\DoctrineBehaviors\\Contract\\Entity\\TreeNodeInterface\>\|ArrayAccess\|null#'
- '#Cannot call method addChildNode\(\) on Knp\\DoctrineBehaviors\\Contract\\Entity\\TreeNodeInterface\|null#'
- '#Property Knp\\DoctrineBehaviors\\Provider\\LocaleProvider\:\:\$translator has no typehint specified#'
- '#PHPDoc tag @var has invalid value \(TranslatorInterface&LocaleAwareInterface\|null\)\: Unexpected token "\|", expected TOKEN_OTHER at offset \d+#'
- '#Call to method getUuid\(\) on an unknown class Knp\\DoctrineBehaviors\\Model\\Uuidable\\UuidableTrait#'
- '#Do not use "\$entityManager->getRepository\(\)" outside of the constructor of repository service#'
# resolve in follow up PR
- '#Use explicit return value over magic &reference#'
- '#Class "(.*?)" with static method must have "static" in its name#'
# used-defined fields
-
path: 'src/EventSubscriber/HashidableEventSubscriber.php'
message: '#Use explicit method names over dynamic#'
-
path: 'src/Model/Sluggable/SluggableMethodsTrait.php'
message: '#Use explicit (method|property fetch) names over dynamic#'
# deprecated class
- '#Class with base "DoctrineBehaviorsBundle" name is already used in "Knp\\DoctrineBehaviors\\DoctrineBehaviorsBundle", "Knp\\DoctrineBehaviors\\Bundle\\DoctrineBehaviorsBundle"\. Use unique name to make classes easy to recognize#'
- '#Use explicit methods, over array acccess on object#'
# magic
-
message: '#Use strict comparison instead of empty#'
paths:
- 'src/Model/Sluggable/SluggableMethodsTrait.php'
- 'src/Model/Translatable/TranslationMethodsTrait.php'
-
message: '#Array with keys is not allowed\. Use value object to pass data instead#'
paths:
# node tree in array
- 'src/Model/Tree/TreeNodeMethodsTrait.php'
# annotation mapping
- src/EventSubscriber/TranslatableEventSubscriber.php
# symplify set
- '#Class "Knp\\DoctrineBehaviors\\Tests\\Fixtures\\Repository\\TreeNodeRepository" inherits from forbidden parent class "Doctrine\\ORM\\EntityRepository"\. Use "composition over inheritance" instead#'
- '#Too many public elements on class \- \d+\. Try narrow it down under 10#'
-
message: '#Do not use static calls#'
paths:
- src/Model/Uuidable/UuidableMethodsTrait.php # 20
- src/Model/Uuidable/UuidableMethodsTrait.php # 32
- tests/bootstrap.php # 14
-
message: '#Do not use factory in constructor#'
paths:
- tests/DatabaseLoader.php # 18
- tests/Fixtures/Entity/SluggableEntity.php # 40
- tests/Fixtures/Entity/SluggableMultiEntity.php # 40
- '#Do not use scalar or array as constructor parameter\. Use ParameterProvider service instead#'
- '#Instead of "DateTime" class/interface use "Nette\\Utils\\DateTime"#'
- '#Do not use trait#'
- '#Do not use setter on a service#'
-
message: '#Node "empty" is fobidden to use#'
paths:
- src/Model/*/*Trait.php
-
message: '#Do not use @method tag in class docblock#'
paths:
- tests/Fixtures/Entity/TranslatableEntity.php
-
message: '#Do not use factory/method call in constructor, put factory in config and get service with dependency injection#'
paths:
- tests/DatabaseLoader.php
- '#Property with protected modifier is not allowed\. Use interface instead#'