Skip to content

Commit bb20a59

Browse files
committed
updated phpstan-baseline
1 parent 1ecb07b commit bb20a59

File tree

2 files changed

+204
-30
lines changed

2 files changed

+204
-30
lines changed

.github/workflows/static-analysis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- uses: actions/checkout@v4
1111
- uses: shivammathur/setup-php@v2
1212
with:
13-
php-version: 8.0
13+
php-version: 8.5
1414
coverage: none
1515

1616
- run: composer install --no-progress --prefer-dist

phpstan-baseline.neon

Lines changed: 203 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,121 +1,295 @@
11
parameters:
22
ignoreErrors:
33
-
4-
message: '#^Match expression does not handle remaining value\: true$#'
4+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Attribute \.\.\.\$attrs\) \{…" on a separate line does not do anything\.$#'
5+
identifier: expr.resultUnused
56
count: 1
67
path: src/PhpGenerator/ClassLike.php
78

89
-
9-
message: '#^Method Nette\\PhpGenerator\\ClassType\:\:addTrait\(\) has parameter \$deprecatedParam with no value type specified in iterable type array\.$#'
10+
message: '#^Parameter \#1 \$class of method Nette\\PhpGenerator\\Printer\:\:printClass\(\) expects Nette\\PhpGenerator\\ClassType\|Nette\\PhpGenerator\\EnumType\|Nette\\PhpGenerator\\InterfaceType\|Nette\\PhpGenerator\\TraitType, \$this\(Nette\\PhpGenerator\\ClassLike\) given\.$#'
11+
identifier: argument.type
12+
count: 1
13+
path: src/PhpGenerator/ClassLike.php
14+
15+
-
16+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Constant \.\.\.\$consts\) \{…" on a separate line does not do anything\.$#'
17+
identifier: expr.resultUnused
18+
count: 1
19+
path: src/PhpGenerator/ClassType.php
20+
21+
-
22+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Method \.\.\.\$methods\) \{…" on a separate line does not do anything\.$#'
23+
identifier: expr.resultUnused
24+
count: 1
25+
path: src/PhpGenerator/ClassType.php
26+
27+
-
28+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Property \.\.\.\$props\) \{…" on a separate line does not do anything\.$#'
29+
identifier: expr.resultUnused
30+
count: 1
31+
path: src/PhpGenerator/ClassType.php
32+
33+
-
34+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\TraitUse \.\.\.\$traits\) \{…" on a separate line does not do anything\.$#'
35+
identifier: expr.resultUnused
1036
count: 1
1137
path: src/PhpGenerator/ClassType.php
1238

1339
-
14-
message: '#^Method Nette\\PhpGenerator\\EnumType\:\:addTrait\(\) has parameter \$deprecatedParam with no value type specified in iterable type array\.$#'
40+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Attribute \.\.\.\$attrs\) \{…" on a separate line does not do anything\.$#'
41+
identifier: expr.resultUnused
42+
count: 1
43+
path: src/PhpGenerator/Closure.php
44+
45+
-
46+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Parameter \.\.\.\$uses\) \{…" on a separate line does not do anything\.$#'
47+
identifier: expr.resultUnused
48+
count: 1
49+
path: src/PhpGenerator/Closure.php
50+
51+
-
52+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Parameter \.\.\.\$val\) \{…" on a separate line does not do anything\.$#'
53+
identifier: expr.resultUnused
54+
count: 1
55+
path: src/PhpGenerator/Closure.php
56+
57+
-
58+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Attribute \.\.\.\$attrs\) \{…" on a separate line does not do anything\.$#'
59+
identifier: expr.resultUnused
60+
count: 1
61+
path: src/PhpGenerator/Constant.php
62+
63+
-
64+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Attribute \.\.\.\$attrs\) \{…" on a separate line does not do anything\.$#'
65+
identifier: expr.resultUnused
66+
count: 1
67+
path: src/PhpGenerator/EnumCase.php
68+
69+
-
70+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Constant \.\.\.\$consts\) \{…" on a separate line does not do anything\.$#'
71+
identifier: expr.resultUnused
1572
count: 1
1673
path: src/PhpGenerator/EnumType.php
1774

1875
-
19-
message: '#^Access to an undefined property PhpParser\\Node\:\:\$attrGroups\.$#'
76+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\EnumCase \.\.\.\$cases\) \{…" on a separate line does not do anything\.$#'
77+
identifier: expr.resultUnused
2078
count: 1
21-
path: src/PhpGenerator/Extractor.php
79+
path: src/PhpGenerator/EnumType.php
2280

2381
-
24-
message: '#^Access to an undefined property PhpParser\\Node\\Expr\:\:\$value\.$#'
82+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Method \.\.\.\$methods\) \{…" on a separate line does not do anything\.$#'
83+
identifier: expr.resultUnused
2584
count: 1
26-
path: src/PhpGenerator/Extractor.php
85+
path: src/PhpGenerator/EnumType.php
86+
87+
-
88+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\TraitUse \.\.\.\$traits\) \{…" on a separate line does not do anything\.$#'
89+
identifier: expr.resultUnused
90+
count: 1
91+
path: src/PhpGenerator/EnumType.php
2792

2893
-
2994
message: '#^Call to an undefined method Nette\\PhpGenerator\\ClassLike\:\:addConstant\(\)\.$#'
95+
identifier: method.notFound
3096
count: 1
3197
path: src/PhpGenerator/Extractor.php
3298

3399
-
34100
message: '#^Call to an undefined method Nette\\PhpGenerator\\ClassLike\:\:addMethod\(\)\.$#'
101+
identifier: method.notFound
35102
count: 1
36103
path: src/PhpGenerator/Extractor.php
37104

38105
-
39106
message: '#^Call to an undefined method Nette\\PhpGenerator\\ClassLike\:\:addProperty\(\)\.$#'
107+
identifier: method.notFound
40108
count: 1
41109
path: src/PhpGenerator/Extractor.php
42110

43111
-
44112
message: '#^Call to an undefined method Nette\\PhpGenerator\\ClassLike\:\:addTrait\(\)\.$#'
113+
identifier: method.notFound
45114
count: 1
46115
path: src/PhpGenerator/Extractor.php
47116

48117
-
49-
message: '#^Method Nette\\PhpGenerator\\Extractor\:\:addCommentAndAttributes\(\) has parameter \$element with no type specified\.$#'
118+
message: '#^Call to function method_exists\(\) with PhpParser\\Node\\Stmt\\ClassConst and ''isFinal'' will always evaluate to true\.$#'
119+
identifier: function.alreadyNarrowedType
50120
count: 1
51121
path: src/PhpGenerator/Extractor.php
52122

53123
-
54-
message: '#^Property class@anonymous/PhpGenerator/Extractor\.php\:176\:\:\$callback has no type specified\.$#'
124+
message: '#^Call to function method_exists\(\) with PhpParser\\Node\\Stmt\\Class_ and ''isReadonly'' will always evaluate to true\.$#'
125+
identifier: function.alreadyNarrowedType
55126
count: 1
56127
path: src/PhpGenerator/Extractor.php
57128

58129
-
59-
message: '#^Variable \$trait might not be defined\.$#'
60-
count: 2
130+
message: '#^Call to function method_exists\(\) with PhpParser\\Node\\Stmt\\Property and ''isReadonly'' will always evaluate to true\.$#'
131+
identifier: function.alreadyNarrowedType
132+
count: 1
61133
path: src/PhpGenerator/Extractor.php
62134

63135
-
64-
message: '#^Call to an undefined method ReflectionClass\<object\>\:\:hasCase\(\)\.$#'
136+
message: '#^Parameter \#1 \$class of method Nette\\PhpGenerator\\Extractor\:\:addEnumCaseToClass\(\) expects Nette\\PhpGenerator\\EnumType, Nette\\PhpGenerator\\ClassLike given\.$#'
137+
identifier: argument.type
65138
count: 1
66-
path: src/PhpGenerator/Factory.php
139+
path: src/PhpGenerator/Extractor.php
140+
141+
-
142+
message: '#^Variable \$class might not be defined\.$#'
143+
identifier: variable.undefined
144+
count: 3
145+
path: src/PhpGenerator/Extractor.php
67146

68147
-
69-
message: '#^Elseif branch is unreachable because previous condition is always true\.$#'
148+
message: '#^Variable \$trait might not be defined\.$#'
149+
identifier: variable.undefined
70150
count: 1
71-
path: src/PhpGenerator/Factory.php
151+
path: src/PhpGenerator/Extractor.php
72152

73153
-
74154
message: '#^Method Nette\\PhpGenerator\\Factory\:\:getAttributes\(\) has parameter \$from with no type specified\.$#'
155+
identifier: missingType.parameter
75156
count: 1
76157
path: src/PhpGenerator/Factory.php
77158

78159
-
79-
message: '#^Method Nette\\PhpGenerator\\Factory\:\:getAttributes\(\) return type has no value type specified in iterable type array\.$#'
160+
message: '#^Variable \$bodies on left side of \?\?\= always exists and is not nullable\.$#'
161+
identifier: nullCoalesce.variable
80162
count: 1
81163
path: src/PhpGenerator/Factory.php
82164

83165
-
84-
message: '#^Method Nette\\PhpGenerator\\Factory\:\:getExtractor\(\) has parameter \$from with no type specified\.$#'
166+
message: '#^Variable \$cache on left side of \?\?\= always exists and is not nullable\.$#'
167+
identifier: nullCoalesce.variable
85168
count: 1
86169
path: src/PhpGenerator/Factory.php
87170

88171
-
89-
message: '#^Method Nette\\PhpGenerator\\Factory\:\:getVisibility\(\) has parameter \$from with no type specified\.$#'
172+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Attribute \.\.\.\$attrs\) \{…" on a separate line does not do anything\.$#'
173+
identifier: expr.resultUnused
90174
count: 1
91-
path: src/PhpGenerator/Factory.php
175+
path: src/PhpGenerator/GlobalFunction.php
92176

93177
-
94-
message: '#^Parameter \#1 \$name of method Nette\\PhpGenerator\\ClassType\:\:setExtends\(\) expects string\|null, array\<int, string\> given\.$#'
178+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Parameter \.\.\.\$val\) \{…" on a separate line does not do anything\.$#'
179+
identifier: expr.resultUnused
95180
count: 1
96-
path: src/PhpGenerator/Factory.php
181+
path: src/PhpGenerator/GlobalFunction.php
97182

98183
-
99-
message: '#^Unreachable statement \- code above always terminates\.$#'
184+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Constant \.\.\.\$consts\) \{…" on a separate line does not do anything\.$#'
185+
identifier: expr.resultUnused
100186
count: 1
101-
path: src/PhpGenerator/Factory.php
187+
path: src/PhpGenerator/InterfaceType.php
102188

103189
-
104-
message: '#^Variable \$bodies on left side of \?\?\= always exists and is not nullable\.$#'
190+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Method \.\.\.\$methods\) \{…" on a separate line does not do anything\.$#'
191+
identifier: expr.resultUnused
105192
count: 1
106-
path: src/PhpGenerator/Factory.php
193+
path: src/PhpGenerator/InterfaceType.php
107194

108195
-
109-
message: '#^Method Nette\\PhpGenerator\\Helpers\:\:formatArgs\(\) has parameter \$args with no value type specified in iterable type array\.$#'
196+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Property \.\.\.\$props\) \{…" on a separate line does not do anything\.$#'
197+
identifier: expr.resultUnused
110198
count: 1
111-
path: src/PhpGenerator/Helpers.php
199+
path: src/PhpGenerator/InterfaceType.php
112200

113201
-
114-
message: '#^Method Nette\\PhpGenerator\\Method\:\:from\(\) has parameter \$method with no value type specified in iterable type array\.$#'
202+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Attribute \.\.\.\$attrs\) \{…" on a separate line does not do anything\.$#'
203+
identifier: expr.resultUnused
115204
count: 1
116205
path: src/PhpGenerator/Method.php
117206

118207
-
119-
message: '#^Method Nette\\PhpGenerator\\TraitType\:\:addTrait\(\) has parameter \$deprecatedParam with no value type specified in iterable type array\.$#'
208+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Parameter \.\.\.\$val\) \{…" on a separate line does not do anything\.$#'
209+
identifier: expr.resultUnused
210+
count: 1
211+
path: src/PhpGenerator/Method.php
212+
213+
-
214+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Attribute \.\.\.\$attrs\) \{…" on a separate line does not do anything\.$#'
215+
identifier: expr.resultUnused
216+
count: 1
217+
path: src/PhpGenerator/Parameter.php
218+
219+
-
220+
message: '#^Instanceof between Nette\\PhpGenerator\\EnumType and Nette\\PhpGenerator\\EnumType will always evaluate to true\.$#'
221+
identifier: instanceof.alwaysTrue
222+
count: 1
223+
path: src/PhpGenerator/Printer.php
224+
225+
-
226+
message: '#^Method Nette\\PhpGenerator\\Printer\:\:printDocComment\(\) has parameter \$commentable with no type specified\.$#'
227+
identifier: missingType.parameter
228+
count: 1
229+
path: src/PhpGenerator/Printer.php
230+
231+
-
232+
message: '#^Parameter \#2 \$array of function implode expects array\<string\>, array\<string, Nette\\PhpGenerator\\PropertyHook\|string\> given\.$#'
233+
identifier: argument.type
234+
count: 2
235+
path: src/PhpGenerator/Printer.php
236+
237+
-
238+
message: '#^Result of \|\| is always true\.$#'
239+
identifier: booleanOr.alwaysTrue
240+
count: 1
241+
path: src/PhpGenerator/Printer.php
242+
243+
-
244+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\PropertyHook \.\.\.\$hooks\) \{…" on a separate line does not do anything\.$#'
245+
identifier: expr.resultUnused
246+
count: 1
247+
path: src/PhpGenerator/PromotedParameter.php
248+
249+
-
250+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Attribute \.\.\.\$attrs\) \{…" on a separate line does not do anything\.$#'
251+
identifier: expr.resultUnused
252+
count: 1
253+
path: src/PhpGenerator/Property.php
254+
255+
-
256+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\PropertyHook \.\.\.\$hooks\) \{…" on a separate line does not do anything\.$#'
257+
identifier: expr.resultUnused
258+
count: 1
259+
path: src/PhpGenerator/Property.php
260+
261+
-
262+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Attribute \.\.\.\$attrs\) \{…" on a separate line does not do anything\.$#'
263+
identifier: expr.resultUnused
264+
count: 1
265+
path: src/PhpGenerator/PropertyHook.php
266+
267+
-
268+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Parameter \.\.\.\$val\) \{…" on a separate line does not do anything\.$#'
269+
identifier: expr.resultUnused
270+
count: 1
271+
path: src/PhpGenerator/PropertyHook.php
272+
273+
-
274+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Constant \.\.\.\$consts\) \{…" on a separate line does not do anything\.$#'
275+
identifier: expr.resultUnused
276+
count: 1
277+
path: src/PhpGenerator/TraitType.php
278+
279+
-
280+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Method \.\.\.\$methods\) \{…" on a separate line does not do anything\.$#'
281+
identifier: expr.resultUnused
282+
count: 1
283+
path: src/PhpGenerator/TraitType.php
284+
285+
-
286+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\Property \.\.\.\$props\) \{…" on a separate line does not do anything\.$#'
287+
identifier: expr.resultUnused
288+
count: 1
289+
path: src/PhpGenerator/TraitType.php
290+
291+
-
292+
message: '#^Expression "\(function \(\\Nette\\PhpGenerator\\TraitUse \.\.\.\$traits\) \{…" on a separate line does not do anything\.$#'
293+
identifier: expr.resultUnused
120294
count: 1
121295
path: src/PhpGenerator/TraitType.php

0 commit comments

Comments
 (0)