forked from drupal-graphql/graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathphpstan.neon
39 lines (38 loc) · 2.02 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
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: 3
customRulesetUsed: true
paths:
- .
# We test with PHPStan on Drupal 8 and 9 and might have different ignored
# errors on both.
reportUnmatchedIgnoredErrors: 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:#"
# Symfony 4 deprecations in Drupal 9 that we don't care about.
- "#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\\.$#"
# 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