-
-
Notifications
You must be signed in to change notification settings - Fork 564
/
phpstan.neon.dist
67 lines (54 loc) · 2.72 KB
/
phpstan.neon.dist
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
parameters:
# TODO increase to max
level: 8
paths:
- benchmarks
- examples
- generate-class-reference.php
- src
- tests
exceptions:
check:
missingCheckedExceptionInThrows: true
tooWideThrowType: true
ignoreErrors:
# Since this is a library that is supposed to be flexible, we don't
# want to lock down every possible extension point.
- "~Unsafe usage of new static\\(\\)~"
# This class uses magic methods to reduce a whole lot of boilerplate required to
# allow partial parsing of language fragments.
- "~Variable method call on GraphQL\\\\Language\\\\Parser\\.~"
# Useful/necessary when dealing with arbitrary user data
- message: "~Variable property access on object~"
path: src/Utils/Utils.php
count: 2
# PHPStan does not play nicely with markTestSkipped()
- message: "~Unreachable statement - code above always terminates~"
path: tests
- message: "#^Property GraphQL\\\\Tests\\\\Type\\\\SchemaTest\\:\\:\\$implementingType is never read, only written\\.$#"
path: tests
# Cannot satisfy input covariance
- '~(expects|should return) array<string, array<string, callable\(GraphQL\\Language\\AST\\Node\): \(GraphQL\\Language\\VisitorOperation\|void\|false\|null\)>\|\(callable\(GraphQL\\Language\\AST\\Node\): \(GraphQL\\Language\\VisitorOperation\|void\|false\|null\)\)>(,| but returns)?~'
# No need to have @throws in methods that are never called
## PHPUnit
- message: "~Method GraphQL\\\\Tests\\\\.+?Test(CaseBase)?::(test.+?|setUp(BeforeClass)?|tearDown)\\(\\) throws checked exception .+? but it's missing from the PHPDoc @throws tag~"
path: tests
## PHPBench
- message: "~it's missing from the PHPDoc @throws tag~"
path: benchmarks
includes:
- phpstan-baseline.neon
- phpstan/include-by-php-version.php
services:
- class: GraphQL\Tests\PhpStan\Type\Definition\Type\IsAbstractTypeStaticMethodTypeSpecifyingExtension
tags:
- phpstan.typeSpecifier.staticMethodTypeSpecifyingExtension
- class: GraphQL\Tests\PhpStan\Type\Definition\Type\IsCompositeTypeStaticMethodTypeSpecifyingExtension
tags:
- phpstan.typeSpecifier.staticMethodTypeSpecifyingExtension
- class: GraphQL\Tests\PhpStan\Type\Definition\Type\IsInputTypeStaticMethodTypeSpecifyingExtension
tags:
- phpstan.typeSpecifier.staticMethodTypeSpecifyingExtension
- class: GraphQL\Tests\PhpStan\Type\Definition\Type\IsOutputTypeStaticMethodTypeSpecifyingExtension
tags:
- phpstan.typeSpecifier.staticMethodTypeSpecifyingExtension