-
-
Notifications
You must be signed in to change notification settings - Fork 154
Expand file tree
/
Copy pathphpstan.neon
More file actions
202 lines (169 loc) 路 6.71 KB
/
Copy pathphpstan.neon
File metadata and controls
202 lines (169 loc) 路 6.71 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
parameters:
level: 8
paths:
- src
excludePaths:
- src/compatibility.php
- src/Iterators/Mapper.php
- src/Utils/ObjectHelpers.php
bootstrapFiles:
- tests/phpstan-bootstrap.php
ignoreErrors:
- # Intentional design pattern: new static() for inheritance support in fluent interfaces
identifier: new.static
message: '#^Unsafe usage of new static\(\)\.$#'
paths:
- src/Utils/ArrayHash.php
- src/Utils/ArrayList.php
- src/Utils/DateTime.php
- src/Utils/DateTimeImmutable.php
- src/Utils/Finder.php
- src/Utils/Html.php
- src/Utils/Image.php
- # Recursive mode converts nested arrays to ArrayHash, so their element type is not T; inexpressible in the type system
identifier: argument.type
message: '#^Parameter \#1 \$array of static method Nette\\Utils\\ArrayHash\<T\>\:\:from\(\) expects array\<T\>, array\<mixed, mixed\>\&T given\.$#'
path: src/Utils/ArrayHash.php
count: 1
- # Runtime validation: type narrowing checks that are necessary at runtime
identifier: function.alreadyNarrowedType
paths:
- src/Utils/ArrayHash.php
- src/Utils/ArrayList.php
- src/Utils/Strings.php
- # Array destructuring from getimagesize() which returns false (converted to null by falseToNull)
identifier: offsetAccess.nonArray
message: '#^Cannot use array destructuring on array<int\|string, int\|string>\|null\.$#'
path: src/Utils/Image.php
count: 2
- # Works with arbitrary PHP callbacks, precise callable types not practical
identifier: missingType.callable
paths:
- src/Utils/Callback.php
- src/Utils/Image.php
- src/Utils/Strings.php
-
message: '#^Parameter \#1 \$key \(\(int\|string\)\) of method Nette\\Utils\\ArrayHash\:\:offsetSet\(\) should be contravariant with parameter \$offset \(int\|string\|null\) of method ArrayAccess\<\(int\|string\),T\>\:\:offsetSet\(\)$#'
identifier: method.childParameterType
count: 1
path: src/Utils/ArrayHash.php
-
message: '#^Call to static method Nette\\Utils\\Arrays\:\:isList\(\) with list\<T\> will always evaluate to true\.$#'
identifier: staticMethod.alreadyNarrowedType
count: 1
path: src/Utils/ArrayList.php
-
message: '#^Cannot access offset string on array\<mixed\>\|object\.$#'
identifier: offsetAccess.nonOffsetAccessible
count: 3
path: src/Utils/Arrays.php
-
message: '#^Method Nette\\Utils\\Arrays\:\:invoke\(\) has parameter \$callbacks with no signature specified for callable\.$#'
identifier: missingType.callable
count: 1
path: src/Utils/Arrays.php
-
message: '#^Parameter \#1 \$objectOrMethod of class Nette\\Utils\\ReflectionMethod constructor expects class\-string\|object, string given\.$#'
identifier: argument.type
count: 1
path: src/Utils/Callback.php
-
message: '#^Left side of && is always true\.$#'
identifier: booleanAnd.leftAlwaysTrue
count: 2
path: src/Utils/DateTime.php
-
message: '#^Ternary operator condition is always true\.$#'
identifier: ternary.alwaysTrue
count: 1
path: src/Utils/DateTimeImmutable.php
-
message: '#^Parameter \#1 \$pathNames of method Nette\\Utils\\Finder\:\:convertToFiles\(\) expects iterable\<string\>, FilesystemIterator given\.$#'
identifier: argument.type
count: 1
path: src/Utils/Finder.php
-
message: '#^Parameter \#2 \$operator of static method Nette\\Utils\\Helpers\:\:compare\(\) expects ''\!\=''\|''\!\=\=''\|''\<''\|''\<\=''\|''\<\>''\|''\=''\|''\=\=''\|''\=\=\=''\|''\>''\|''\>\='', non\-falsy\-string given\.$#'
identifier: argument.type
count: 2
path: src/Utils/Finder.php
-
message: '#^Trying to invoke non\-falsy\-string but it might not be a callable\.$#'
identifier: callable.nonCallable
count: 1
path: src/Utils/Finder.php
-
message: '#^Variable \$res on left side of \?\?\= always exists and is not nullable\.$#'
identifier: nullCoalesce.variable
count: 1
path: src/Utils/Finder.php
-
message: '#^Match arm comparison between ''\!\=\='' and ''\!\=\='' is always true\.$#'
identifier: match.alwaysTrue
count: 1
path: src/Utils/Helpers.php
-
message: '#^Comparison operation "\<" between int\<1, max\> and 1 is always false\.$#'
identifier: smaller.alwaysFalse
count: 2
path: src/Utils/Image.php
-
message: '#^Match arm comparison between 6 and 6 is always true\.$#'
identifier: match.alwaysTrue
count: 2
path: src/Utils/Image.php
-
message: '#^Offset 1\|2\|3\|6\|18\|19 on array\{2\: ''jpeg'', 3\: ''png'', 1\: ''gif'', 18\: ''webp'', 19\: ''avif'', 6\: ''bmp''\} in isset\(\) always exists and is not nullable\.$#'
identifier: isset.offset
count: 1
path: src/Utils/Image.php
-
message: '#^Result of \|\| is always false\.$#'
identifier: booleanOr.alwaysFalse
count: 1
path: src/Utils/Image.php
-
message: '#^Parameter \#1 \$class of class ReflectionClassConstant constructor expects class\-string\|object, string given\.$#'
identifier: argument.type
count: 1
path: src/Utils/Reflection.php
-
message: '#^Right side of && is always true\.$#'
identifier: booleanAnd.rightAlwaysTrue
count: 2
path: src/Utils/Reflection.php
-
message: '#^Parameter \#1 \$objectOrClass of class ReflectionClass constructor expects class\-string\<object\>\|object, object\|string given\.$#'
identifier: argument.type
count: 1
path: src/Utils/ReflectionMethod.php
-
message: '#^Parameter \#2 \$method of method ReflectionMethod\:\:__construct\(\) expects string, string\|null given\.$#'
identifier: argument.type
count: 1
path: src/Utils/ReflectionMethod.php
-
message: '#^Method Nette\\Utils\\Strings\:\:match\(\) should return array\<string\>\|null but returns array\<array\<int, int\|string\>\>\.$#'
identifier: return.type
count: 1
path: src/Utils/Strings.php
-
message: '#^Strict comparison using \!\=\= between string and false will always evaluate to true\.$#'
identifier: notIdentical.alwaysTrue
count: 1
path: src/Utils/Strings.php
-
message: '#^Parameter \#1 \$givenTypes of method Nette\\Utils\\Type\:\:allowsAny\(\) expects array\<string\>, list\<Nette\\Utils\\Type\|string\> given\.$#'
identifier: argument.type
count: 2
path: src/Utils/Type.php
-
message: '#^Parameter \#1 \$ourTypes of method Nette\\Utils\\Type\:\:allowsAll\(\) expects array\<string\>, list\<Nette\\Utils\\Type\|string\> given\.$#'
identifier: argument.type
count: 2
path: src/Utils/Type.php
-
message: '#^Parameter \#2 \$of of static method Nette\\Utils\\Type\:\:resolve\(\) expects ReflectionFunction\|ReflectionMethod\|ReflectionParameter\|ReflectionProperty, ReflectionFunctionAbstract\|ReflectionParameter\|ReflectionProperty given\.$#'
identifier: argument.type
count: 1
path: src/Utils/Type.php