forked from KnpLabs/DoctrineBehaviors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpstan.neon
103 lines (80 loc) · 4.92 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
includes:
- phpstan-extension.neon
- vendor/symplify/phpstan-rules/config/static-rules.neon
- vendor/symplify/phpstan-rules/config/array-rules.neon
- vendor/symplify/phpstan-rules/config/doctrine-rules.neon
- vendor/symplify/phpstan-rules/config/regex-rules.neon
- vendor/symplify/phpstan-rules/config/services-rules.neon
- vendor/symplify/phpstan-rules/config/size-rules.neon
- vendor/symplify/phpstan-rules/config/forbidden-static-rules.neon
- vendor/symplify/phpstan-rules/config/string-to-constant-rules.neon
- vendor/symplify/phpstan-rules/config/symfony-rules.neon
- vendor/symplify/phpstan-rules/config/test-rules.neon
parameters:
paths:
- src
- tests
level: max
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#'
# cache buggy
- '#Access to an undefined property Knp\\DoctrineBehaviors\\Tests\\Fixtures\\Entity\\TreeNodeEntity\:\:\$parentNodePath#'
- '#Property with protected modifier is not allowed\. Use interface contract method instead#'
# 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+#'
- '#Do not use "\$entityManager->getRepository\(\)" outside of the constructor of repository service#'
# resolve in follow up PR
- '#Use explicit return value over magic &reference#'
# magic
-
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
- '#Do not use trait#'
- '#Do not use setter on a service#'
-
message: '#Do not use @method tag in class docblock#'
paths:
- tests/Fixtures/Entity/TranslatableEntity.php
- '#"Doctrine\\ORM\\EntityManagerInterface" dependency is allowed only in "\*Repository" types#'
-
message: '#Use explicit methods over array access on object#'
paths:
- tests/ORM/TreeNodeTest.php
- '#"%s" in sprintf\(\) format must be quoted#'
- '#Method call on new expression is not allowed#'
- '#Do not use factory/method call in constructor\. Put factory in config and get service with dependency injection#'
- '#Property Knp\\DoctrineBehaviors\\Tests\\ORM\\Blameable\\BlameableWithEntityTest\:\:\$userEntity \(Knp\\DoctrineBehaviors\\Tests\\Fixtures\\Entity\\UserEntity\) does not accept object\|string\|null#'
- '#\$this as argument is not allowed\. Refactor method to service composition#'
- '#Use separate function calls with readable variable names#'
-
message: '#Do not compare call directly, use a variable assign#'
path: src/Model/*/*MethodsTrait.php
-
message: '#For complex configuration use value object over array#'
path: tests/config/config_test.php
- '#Parameter \#1 \$type of method Symplify\\PackageBuilder\\Testing\\AbstractKernelTestCase\:\:getService\(\) expects class\-string<doctrine\.orm\.entity_manager\>, string given#'
- '#Property Knp\\DoctrineBehaviors\\Tests\\AbstractBehaviorTestCase\:\:\$entityManager \(Doctrine\\ORM\\EntityManagerInterface\) does not accept T of object#'
- '#Parameter \#1 \$input of function array_filter expects array, array<int, string\>\|false given#'
-
message: '#Use dependency injection instead of dependency juggling#'
path: tests/DatabaseLoader.php