forked from nuwave/lighthouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpstan.neon
More file actions
71 lines (58 loc) · 3.46 KB
/
phpstan.neon
File metadata and controls
71 lines (58 loc) · 3.46 KB
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
includes:
- vendor/bensampo/laravel-enum/extension.neon
- vendor/nesbot/carbon/extension.neon
- vendor/nunomaduro/larastan/extension.neon
- vendor/phpstan/phpstan-mockery/extension.neon
- vendor/thecodingmachine/phpstan-safe-rule/phpstan-safe-rule.neon
parameters:
level: max
paths:
- benchmarks
- src
- tests
excludes_analyse:
- tests/database/migrations/*
# Indirectly refers to \App\User (maybe through larastan?)
- tests/Utils/Models/User.php
# Intentionally wrong
- tests/Utils/Models/WithoutRelationClassImport.php
# Compatibility fix because Laravel moved the TestResponse class
- tests/TestCase.php
- tests/Laravel7ExceptionHandler.php
- tests/PreLaravel7ExceptionHandler.php
# As long as we support multiple Laravel versions at once, there will be some dead spots
reportUnmatchedIgnoredErrors: false
ignoreErrors:
# Some parts of Laravel are just really magical
- '#Parameter \#1 \$callable of static method Closure::fromCallable\(\) expects callable\(\): mixed, array\(\*NEVER\*, .*\) given\.#'
- path: tests/database/factories/*
message: '#Variable \$factory might not be defined#'
- '#Function factory invoked with 2 parameters, 0 required\.#'
- '#Function factory invoked with 1 parameter, 0 required\.#'
- '#Parameter \#1 \$callback of method Illuminate\\Support\\Collection<mixed,mixed>::mapWithKeys\(\) expects callable\(mixed, mixed\): array, Closure\(Illuminate\\Support\\Collection\): Illuminate\\Database\\Eloquent\\Collection given\.#'
# This test cheats and uses reflection to make assertions
- path: tests/Unit/Schema/Directives/BaseDirectiveTest.php
message: '#Call to protected method getModelClass\(\) of class Nuwave\\Lighthouse\\Schema\\Directives\\BaseDirective\.#'
# Can not specify a class-string for traits
- path: src/Schema/Directives/SearchDirective.php
message: '#PHPDoc tag @var for variable \$modelClass contains unresolvable type\.#'
# Correctly writing out the union of all the subtypes of AST nodes is too much work
- '#Access to an undefined property GraphQL\\Language\\AST\\Node::\$name\.#'
- '#Access to an undefined property GraphQL\\Language\\AST\\Node::\$directives\.#'
- '#Access to an undefined property GraphQL\\Language\\AST\\TypeNode::\$kind\.#'
- '#.* expects GraphQL\\Language\\AST\\Node, GraphQL\\Language\\AST\\TypeDefinitionNode given\.#'
- '#PHPDoc tag @param for parameter \$definition with type GraphQL\\Language\\AST\\FieldDefinitionNode\|GraphQL\\Language\\AST\\TypeDefinitionNode is not subtype of native type GraphQL\\Language\\AST\\Node\.#'
# Should work once we update to a version of graphql-php that has more accurate types
- '#Cannot call method merge\(\) on array<GraphQL\\Language\\AST\\ArgumentNode>\.#'
- '#.* does not accept GraphQL\\Language\\AST\\NodeList.*#'
# This class or an equivalent of it will be present in a Laravel install
- '#.* unknown class App\\User\.#'
# This is a library, so it should be extendable
- '#Unsafe usage of new static.*#'
# Compatibility fix because Laravel moved the TestResponse class
- '#.*TestResponse.*#'
- '#Unable to resolve the template type ExpectedType in call to method PHPUnit\\Framework\\Assert::assertSame\(\)#'
# We are monkeypatching ResolveInfo to pass information through resolver middleware
- '#Access to an undefined property GraphQL\\Type\\Definition\\ResolveInfo::\$argumentSet\.#'
# This really has no type in root resolvers
- '#Method .* has parameter \$root with no typehint specified\.#'