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
89 lines (75 loc) · 5.55 KB
/
phpstan.neon
File metadata and controls
89 lines (75 loc) · 5.55 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
includes:
- vendor/bensampo/laravel-enum/extension.neon
- vendor/nunomaduro/larastan/extension.neon
- vendor/phpstan/phpstan-mockery/extension.neon
parameters:
level: 5
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
# Will be obsolote in v5
- src/Schema/Factories/FieldFactory.php
- src/Schema/AST/PartialParser.php
- src/Schema/Directives/MiddlewareDirective.php
ignoreErrors:
# Some parts of Laravel are just really magical
- '#Call to an undefined static method Illuminate\\Support\\Facades\\Event::assertDispatched\(\)\.#'
- '#Call to protected static method get\(\) of class Illuminate\\Filesystem\\FilesystemManager\.#'
- '#Parameter \#1 \$callable of static method Closure::fromCallable\(\) expects callable\(\): mixed, array\(\*NEVER\*, .*\) given\.#'
- path: tests/database/factories/*
message: '#Undefined variable: \$factory#'
- '#Call to an undefined static method Illuminate\\Database\\Eloquent\\Model::find\(\)\.#'
- '#Function factory invoked with 2 parameters, 0 required\.#'
- '#Function factory invoked with 1 parameter, 0 required\.#'
# 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::\$kind\.#'
- '#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\.#'
- '#Access to an undefined property GraphQL\\Language\\AST\\TypeNode::\$name\.#'
- '#Access to an undefined property GraphQL\\Language\\AST\\TypeSystemDefinitionNode::\$directives\.#'
- '#Access to an undefined property GraphQL\\Language\\AST\\TypeDefinitionNode::\$name\.#'
- '#Access to an undefined property GraphQL\\Language\\AST\\TypeExtensionNode::\$name\.#'
- '#.* expects GraphQL\\Language\\AST\\Node, GraphQL\\Language\\AST\\TypeDefinitionNode given\.#'
- '#.* expects GraphQL\\Language\\AST\\Node, GraphQL\\Language\\AST\\ValueNode given\.#'
- '#.* expects GraphQL\\Type\\Definition\\Type, GraphQL\\Type\\Definition\\InputType given\.#'
# 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>\.#'
- '#Cannot call method merge\(\) on array<GraphQL\\Language\\AST\\FieldDefinitionNode>\.#'
- '#Property GraphQL\\Language\\AST\\InputObjectTypeDefinitionNode::\$fields \(array<GraphQL\\Language\\AST\\InputValueDefinitionNode>\|null\) does not accept GraphQL\\Language\\AST\\NodeList\.#'
- '#Property GraphQL\\Language\\AST\\ObjectTypeDefinitionNode::\$fields \(array<GraphQL\\Language\\AST\\FieldDefinitionNode>\|null\) does not accept GraphQL\\Language\\AST\\NodeList\.#'
- '#Property GraphQL\\Language\\AST\\ObjectTypeDefinitionNode::\$interfaces \(array<GraphQL\\Language\\AST\\NamedTypeNode>\) does not accept GraphQL\\Language\\AST\\NodeList\.#'
- '#Property GraphQL\\Language\\AST\\DocumentNode::\$definitions \(GraphQL\\Language\\AST\\NodeList&iterable<GraphQL\\Language\\AST\\DefinitionNode>\) does not accept array<GraphQL\\Language\\AST\\FragmentDefinitionNode>\.#'
- '#Instanceof between GraphQL\\Language\\AST\\ListTypeNode\|GraphQL\\Language\\AST\\NameNode and GraphQL\\Language\\AST\\NamedTypeNode will always evaluate to false\.#'
- '#Parameter \#1 \$list of method GraphQL\\Language\\AST\\NodeList::merge\(\) expects GraphQL\\Language\\AST\\NodeList&iterable<GraphQL\\Language\\AST\\Node>, GraphQL\\Language\\AST\\NodeList\|iterable<GraphQL\\Language\\AST\\Node> given\.#'
- '#Parameter \#1 \$list of method GraphQL\\Language\\AST\\NodeList::merge\(\) expects GraphQL\\Language\\AST\\NodeList&iterable<GraphQL\\Language\\AST\\Node>, array<int, GraphQL\\Language\\AST\\DirectiveNode> given\.#'
# 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.*#'
# We are monkeypatching ResolveInfo to pass information through resolver middleware
- '#Access to an undefined property GraphQL\\Type\\Definition\\ResolveInfo::\$builder\.#'
- '#Access to an undefined property GraphQL\\Type\\Definition\\ResolveInfo::\$argumentSet\.#'
# TODO remove once we no longer need PartialParser
- '#Method Nuwave\\Lighthouse\\Schema\\AST\\PartialParser::.*\(\) should return GraphQL\\Language\\AST\\.* but returns GraphQL\\Language\\AST\\Node\.#'
# TODO remove once we no longer support PHPUnit 7
- '#Parameter \$invocationOrder of method Tests\\TestCase::mockResolverExpects\(\) has invalid typehint type PHPUnit\\Framework\\MockObject\\Rule\\InvocationOrder\.#'