forked from drupal-graphql/graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpstan.neon
89 lines (83 loc) · 4.75 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
includes:
- ../../vendor/phpstan/phpstan-deprecation-rules/rules.neon
- ../../vendor/mglaman/phpstan-drupal/extension.neon
- ../../vendor/jangregor/phpstan-prophecy/extension.neon
- ../../vendor/phpstan/phpstan-phpunit/extension.neon
parameters:
# PHPStan cannot find files in this test directory automatically.
scanDirectories:
- ../../core/tests/Drupal/Tests
level: 6
customRulesetUsed: true
paths:
- .
# We test with PHPStan on Drupal 8 and 9 and might have different ignored
# errors on both.
reportUnmatchedIgnoredErrors: false
# We inherit a lot of Drupal core docs that don't specify iterable types on
# arrays, not sure we can fix this in a good way.
checkMissingIterableValueType: false
# Not sure we can specify generic types properly with Drupal coding standards
# yet, disable for now.
checkGenericClassInNonGenericObjectType: false
ignoreErrors:
# @todo Ignore phpstan-drupal extension's rules for now, activate later.
- '#\Drupal calls should be avoided in classes, use dependency injection instead#'
# new static() is a best practice in Drupal, so we cannot fix that.
- "#^Unsafe usage of new static\\(\\)\\.$#"
# Drupal allows object property access to custom fields, so we cannot fix
# that.
- "#^Access to an undefined property Drupal\\\\#"
# PHPUnit deprecation warnings in Drupal 9 that we don't care about.
- "#^Call to deprecated method setMethods\\(\\) of class PHPUnit\\\\Framework\\\\MockObject\\\\MockBuilder:#"
# Other deprecations in Drupal 9 that we can't change because we want to
# support Drupal 8.
- "#deprecated class Symfony\\\\Component\\\\EventDispatcher\\\\Event#"
- "#deprecated class Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\GetResponseEvent#"
- "#^Method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) invoked with 2 parameters, 1 required\\.$#"
- "#deprecated interface Symfony\\\\Component\\\\HttpFoundation\\\\File\\\\MimeType\\\\MimeTypeGuesserInterface#"
- "#^Parameter .+ of class Symfony\\\\Component\\\\HttpFoundation\\\\File\\\\UploadedFile constructor expects .+ given\\.$#"
- "#^Parameter \\#1 \\$event of method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch\\(\\) expects object, string given\\.$#"
- """
#^Call to deprecated method toInt\\(\\) of class Drupal\\\\Component\\\\Utility\\\\Bytes\\:
in drupal\\:9\\.1\\.0 and is removed from drupal\\:10\\.0\\.0\\. Use \\\\Drupal\\\\Component\\\\Utility\\\\Bytes\\:\\:toNumber\\(\\) instead$#
"""
- """
#^Call to deprecated function file_munge_filename\\(\\)#
"""
# Drupal allows object property access to custom fields, so we cannot fix
# that.
- "#^Property Drupal\\\\.+ \\(Drupal\\\\Core\\\\Field\\\\FieldItemListInterface\\) does not accept .+\\.$#"
# Incomplete type doc comments in Drupal core that we have to ignore.
-
message: "#^Method Drupal\\\\graphql\\\\Plugin\\\\LanguageNegotiation\\\\OperationLanguageNegotiation\\:\\:getLangcode\\(\\) should return string but returns false\\.$#"
count: 1
path: src/Plugin/LanguageNegotiation/OperationLanguageNegotiation.php
- "#^Parameter .+ of method Drupal\\\\Core\\\\Entity\\\\Query\\\\QueryInterface\\:\\:range\\(\\) expects null, int given\\.$#"
# We forgot to use return type hints on some interfaces, cannot be changed
# in stable 4.0.
# @todo use return type hints everywhere for 5.0.
-
message: "#^Method Drupal\\\\graphql\\\\Entity\\\\ServerInterface\\:\\:addPersistedQueryInstance\\(\\) has no return typehint specified\\.$#"
count: 1
path: src/Entity/ServerInterface.php
-
message: "#^Method Drupal\\\\graphql\\\\Entity\\\\ServerInterface\\:\\:removePersistedQueryInstance\\(\\) has no return typehint specified\\.$#"
count: 1
path: src/Entity/ServerInterface.php
-
message: "#^Method Drupal\\\\graphql\\\\Entity\\\\ServerInterface\\:\\:removeAllPersistedQueryInstances\\(\\) has no return typehint specified\\.$#"
count: 1
path: src/Entity/ServerInterface.php
-
message: "#^Method Drupal\\\\graphql\\\\Plugin\\\\PersistedQueryPluginInterface\\:\\:setWeight\\(\\) has no return typehint specified\\.$#"
count: 1
path: src/Plugin/PersistedQueryPluginInterface.php
-
message: "#^Method Drupal\\\\graphql\\\\Plugin\\\\SchemaExtensionPluginInterface\\:\\:registerResolvers\\(\\) has no return typehint specified\\.$#"
count: 1
path: src/Plugin/SchemaExtensionPluginInterface.php
-
message: "#^Unable to resolve the template type ExpectedType in call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\)$#"
count: 1
path: tests/src/Kernel/ResolverBuilderTest.php