This repository was archived by the owner on Dec 3, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathphpstan.neon
85 lines (69 loc) · 4.24 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
includes:
- vendor/symplify/phpstan-extensions/config/config.neon
- vendor/phpstan/phpstan-symfony/extension.neon
- vendor/phpstan/phpstan-symfony/rules.neon
- vendor/phpstan/phpstan-phpunit/extension.neon
- vendor/symplify/phpstan-rules/config/static-rules.neon
- vendor/symplify/phpstan-rules/config/services/services.neon
parameters:
paths:
- packages
level: max
checkGenericClassInNonGenericObjectType: false
reportUnmatchedIgnoredErrors: false
excludes_analyse:
# tests
- 'packages/vendor-patches/tests/Finder/*'
- 'packages/template-checker/tests/PhpParser/LatteFilterProviderGenerator/Source/SomeHelper.php'
- packages/sniffer-fixer-to-ecs/stubs
ignoreErrors:
- '#(.*?) return type has no value type specified in iterable type array#'
- '#Cannot cast array<string\>\|string\|null to string#'
# mixed
- '#no value type specified in iterable type#'
- '#with no typehint specified#'
- '#has no return typehint specified#'
- '#Call to an undefined method Psr\\Container\\ContainerInterface\:\:getParameter\(\)#'
- '#Cannot cast array<string\>\|bool\|string\|null to string#'
- '#Cannot cast array<string\>\|bool\|string\|null to int#'
- '#Variable \$methodCall might not be defined#'
- '#Method Migrify\\PhpConfigPrinter\\NodeTraverser\\ImportFullyQualifiedNamesNodeTraverser\:\:createUses\(\) should return array<PhpParser\\Node\\Stmt\\Use_\> but returns array<int, PhpParser\\Node\>#'
- '#Parameter \#5 \$default of method Symfony\\Component\\Console\\Command\\Command\:\:addOption\(\) expects (.*?), float given#'
# xml
- '#Parameter \#1 \$type of method PhpParser\\Builder\\FunctionLike\:\:setReturnType\(\) expects PhpParser\\Node\\Name\|PhpParser\\Node\\NullableType\|string, PhpParser\\Node\\Identifier\|PhpParser\\Node\\Name\|PhpParser\\Node\\NullableType\|PhpParser\\Node\\UnionType given#'
- '#Parameter \#1 \$argument of class ReflectionClass constructor expects class\-string<T of object\>\|T of object, string given#'
# XML object, nothing we can do about it
-
message: '#Nested foreach with empty statement is not allowed#'
paths:
- packages/sniffer-fixer-to-ecs/src/SnifferToECSConverter.php
# for testing purposes
-
message: '#Instead of container injection, use specific service#'
paths:
- packages/symfony-route-usage/tests/Helper/DatabaseLoaderHelper.php
- '#Parameter \#1 \$items of class PhpParser\\Node\\Expr\\Array_ constructor expects array<PhpParser\\Node\\Expr\\ArrayItem\|null\>, array<PhpParser\\Node\\Arg\> given#'
-
message: '#Do not use factory/method call in constructor\. Put factory in config and get service with dependency injection#'
paths:
- packages/symfony-route-usage/src/Database/TableInitiator.php
-
message: '#Do not use scalar or array as constructor parameter\. Use ParameterProvider service instead#'
paths:
- packages/migrify-kernel/src/Bootstrap/KernelBootAndApplicationRun.php # 34
- packages/migrify-kernel/src/Bootstrap/KernelBootAndApplicationRun.php # 35
-
message: '#Constant string value need to only have small letters, _, \-, \. and numbers#'
paths:
- packages/diff-data-miner/src/Extractor/ClassChangesExtractor.php # 17
- packages/phpmd-decomposer/src/PHPMDDecomposer/PHPStanConfigFactory.php # 38
- packages/template-checker/src/PhpParser/LatteFilterProviderGenerator.php # 31
# kind of on purpose
-
message: '#Unreachable statement \- code above always terminates#'
paths:
- packages/symfony-route-usage/tests/EntityRepository/RouteVisitRepositoryTest.php # 24
- packages/symfony-route-usage/tests/Routing/DeadRoutesProviderTest.php # 23
-
message: '#Constant string value need to only have small letters, _, \-, \. and numbers#'
path: packages/class-presence/tests/Regex/NonExistingClassConstantExtractor/Source/ClassWithConstants.php