-
Notifications
You must be signed in to change notification settings - Fork 1
/
phpstan-baseline-well-known.neon
106 lines (94 loc) · 6.08 KB
/
phpstan-baseline-well-known.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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
parameters:
excludePaths:
- packages/testing/docs/Examples/TestCase.php
ignoreErrors:
# Unwanted strict rules
# (is there a better way to disable them?)
-
message: "#does not call parent constructor from#"
path: packages/**/*Test.php
# Larastan doesn't support phpstan/phpstan-strict-rules
# https://github.com/phpstan/phpstan-strict-rules/issues/140
- "#^Dynamic call to static method Illuminate\\\\Contracts\\\\Foundation\\\\CachesConfiguration\\:\\:(configurationIsCached|routesAreCached|langPath)\\(\\)\\.$#"
- "#^Dynamic call to static method Illuminate\\\\Contracts\\\\Foundation\\\\CachesRoutes\\:\\:routesAreCached\\(\\)\\.$#"
- "#^Dynamic call to static method Illuminate\\\\Validation\\\\Factory\\:\\:(validate)\\(\\)\\.$#"
- "#^Dynamic call to static method Illuminate\\\\Testing\\\\TestResponse\\<[^>]+\\>\\:\\:assert[^(]+\\(\\)\\.$#"
- "#^Dynamic call to static method Illuminate\\\\Database\\\\Eloquent\\\\Model(\\<[^>]+\\>)?\\:\\:[^(]+\\(\\)\\.$#"
- "#^Dynamic call to static method Illuminate\\\\Database\\\\Eloquent\\\\Builder(\\<[^>]+\\>)?\\:\\:[^(]+\\(\\)\\.$#"
- "#^Dynamic call to static method Illuminate\\\\Database\\\\Eloquent\\\\Relations\\\\[^\\\\]+(\\<[^>]+\\>)?\\:\\:[^(]+\\(\\)\\.$#"
# Sometimes it is needed...
# https://github.com/phpstan/phpstan/issues/3296
-
message: "#^Variable method call on .+?\\.$#"
paths:
- packages/eloquent/src/ModelHelper.php
-
message: "#^Variable property access on .+?\\.$#"
paths:
- packages/serializer/src/Normalizers/SerializableNormalizer.php
-
message: "#Calling putenv\\(\\) is forbidden, might overwrite existing variables\\.#"
paths:
- packages/documentator/src/Processor/Tasks/Preprocess/Instructions/IncludeArtisan/Instruction.php
# False positive
# https://github.com/nunomaduro/larastan/issues/483
# https://github.com/nunomaduro/larastan/pull/917
-
message: "#^Dynamic call to static method Symfony\\\\Component\\\\HttpFoundation\\\\Response::getContent\\(\\)\\.$#"
paths:
- packages/testing/src/Mixins/TestResponseMixin.php
# False positive
# https://github.com/phpstan/phpstan-mockery/issues/34
-
message: "#^Creating callable from Mockery\\\\MockInterface but it might not be a callable\\.$#"
paths:
- packages/**/*Test.php
# False positive
# https://github.com/phpstan/phpstan-mockery/issues/18
-
message: "#^Call to protected method (getResolverRelation|getResolverModel|getResolverClass|getFieldValue)\\(\\) of class LastDragon_ru\\\\LaraASP\\\\GraphQL\\\\Stream\\\\Directives\\\\Directive\\.$#"
paths:
- packages/graphql/src/Stream/Directives/DirectiveTest.php
-
message: "#^Call to protected method getNulls\\(\\) of class LastDragon_ru\\\\LaraASP\\\\GraphQL\\\\SortBy\\\\Operators\\\\Sort\\.$#"
paths:
- packages/graphql/src/SortBy/Operators/SortTest.php
-
message: "#^Call to protected method getBuilder\\(\\) of class LastDragon_ru\\\\LaraASP\\\\GraphQL\\\\Stream\\\\Directives\\\\Directive\\.$#"
paths:
- packages/graphql/src/Stream/Directives/DirectiveTest.php
# PHPStan doesn't allow use `@var` and `assert()` for `$this` inside Closure yet
# https://github.com/phpstan/phpstan/issues/149
# https://github.com/phpstan/phpstan/issues/8904
# https://github.com/phpstan/phpstan/issues/11267
-
message: "#^PHPDoc tag @var with type Illuminate\\\\Database\\\\Eloquent\\\\Builder\\<Illuminate\\\\Database\\\\Eloquent\\\\Model\\> is not subtype of native type \\$this\\(LastDragon_ru\\\\LaraASP\\\\Eloquent\\\\Mixins\\\\EloquentBuilderMixin\\)\\.$#"
paths:
- packages/eloquent/src/Mixins/EloquentBuilderMixin.php
-
message: "#^PHPDoc tag @var with type Illuminate\\\\Testing\\\\TestResponse\\<Symfony\\\\Component\\\\HttpFoundation\\\\Response\\> is not subtype of native type \\$this\\(LastDragon_ru\\\\LaraASP\\\\Testing\\\\Mixins\\\\TestResponseMixin\\)\\.$#"
paths:
- packages/testing/src/Mixins/TestResponseMixin.php
# False positive for non-initialized properties (Laravel specific)
# https://github.com/phpstan/phpstan/issues/10305
- "#^Property Illuminate\\\\Database\\\\Query\\\\Builder::\\$orders \\(array\\) on left side of \\?\\? is not nullable\\.$#"
- "#^Property Illuminate\\\\Database\\\\Query\\\\Builder::\\$unionOrders \\(array\\) on left side of \\?\\? is not nullable\\.$#"
# (dev) Required for tests
-
message: "#^Class `[^`]+` must be marked by `@internal`\\.$#"
paths:
- packages/dev/src/PhpStan/ClassMustBeInternal/RuleTest.php
# Symfony v6 compatibility
-
message: "#^[^:]+::getSupportedTypes\\(\\) overrides method [^:]+::getSupportedTypes\\(\\) but is missing the \\#\\[\\\\Override\\] attribute\\.$#"
paths:
- packages/serializer/src/Normalizers/DateTimeNormalizer.php
- packages/serializer/src/Normalizers/SerializableNormalizer.php
- packages/serializer/src/Normalizers/UnitEnumNormalizer.php
# Not supported yet (`class-string-map`)
# https://github.com/phpstan/phpstan/discussions/11736
# https://github.com/phpstan/phpstan/issues/9521 (?)
-
message: "#^Method LastDragon_ru\\\\LaraASP\\\\Documentator\\\\Processor\\\\Factory::tasks\\(\\) should return array<class-string<LastDragon_ru\\\\LaraASP\\\\Documentator\\\\Processor\\\\Contracts\\\\Task>, \\(Closure\\(LastDragon_ru\\\\LaraASP\\\\Documentator\\\\Processor\\\\Contracts\\\\Task\\): void\\)\\|null> but returns#"
paths:
- packages/documentator/src/Processor/Factory.php