forked from nuwave/lighthouse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
phpstan.neon
58 lines (48 loc) · 3.23 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
parameters:
level: 8 # TODO level up to max
stubFiles:
- _ide_helper.php
paths:
- benchmarks
- src
- tests
checkOctaneCompatibility: true
reportUnmatchedIgnoredErrors: false # As long as we support multiple Laravel versions at once, there will be some dead spots
# Install https://plugins.jetbrains.com/plugin/7677-awesome-console to make those links clickable
editorUrl: '%%relFile%%:%%line%%'
editorUrlTitle: '%%relFile%%:%%line%%'
tmpDir: phpstan-tmp-dir
excludePaths:
- tests/Utils/Models/WithoutRelationClassImport.php # Intentionally wrong
- tests/LaravelPhpdocAlignmentFixer.php # Copied from laravel/pint
ignoreErrors:
# PHPStan does not get it
- '#Parameter \#1 \$callback of static method Closure::fromCallable\(\) expects callable\(\): mixed, array{object, .*} given\.#'
# Some parts of Laravel are just really magical
- '#Parameter \#1 \$response of static method Nuwave\\Lighthouse\\Testing\\TestResponseUtils::extractValidationErrors\(\) expects Illuminate\\Testing\\TestResponse, \$this\(Nuwave\\Lighthouse\\Testing\\TestResponseMixin\) given\.#'
- path: tests/database/factories/*
message: '#Variable \$factory might not be defined#'
# Mixins are magical
- path: src/Testing/TestResponseMixin.php
message: '#Method Nuwave\\Lighthouse\\Testing\\TestResponseMixin::assertGraphQLErrorMessage\(\) invoked with 1 parameter, 0 required\.#'
- path: src/Testing/TestResponseMixin.php
message: '#Method Nuwave\\Lighthouse\\Testing\\TestResponseMixin::assertGraphQLDebugMessage\(\) invoked with 1 parameter, 0 required\.#'
- path: src/Testing/TestResponseMixin.php
message: '#Anonymous function should return Illuminate\\Testing\\TestResponse but returns .*#'
# Relation forwards calls to Builder
- '#Call to an undefined method Illuminate\\Database\\Eloquent\\Builder<Illuminate\\Database\\Eloquent\\Model>|Illuminate\\Database\\Eloquent\\Relations\\Relation<Illuminate\\Database\\Eloquent\\Model>|Illuminate\\Database\\Query\\Builder::(orderBy|where|whereIn|whereNotIn|whereBetween|whereJsonContains|whereNotBetween)\(\)\.#'
# 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\.#'
# This is a library, so it should be extendable
- '#Unsafe usage of new static.*#'
# Ease transition for non-nullable properties towards native types https://github.com/phpstan/phpstan/issues/5150
- '#Property .* in isset\(\) is not nullable\.#'
# Unavailable in thecodingmachine/safe:1
- '#Function (hrtime) is unsafe to use\. It can return FALSE instead of throwing an exception\.#'
# Unavailable in thecodingmachine/safe:2
- '#Function (sort|substr|ksort) is unsafe to use\. It can return FALSE instead of throwing an exception\.#'
# Lumen type hints are just wrong
- '#Parameter \#1 \$content of function response expects string, .* given\.#'
# Seems like a bug in PHPStan
- '#Parameter \#2 \$type of method Nuwave\\Lighthouse\\Schema\\TypeRegistry::.+Lazy\(\) expects callable\(\): GraphQL\\Type\\Definition\\Type&GraphQL\\Type\\Definition\\NamedType, Closure\(\): GraphQL\\Type\\Definition\\ObjectType given\.#'