Skip to content

Commit 6672d40

Browse files
committed
fixed PHPStan errors
1 parent b9f4038 commit 6672d40

5 files changed

Lines changed: 448 additions & 5 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"nette/tester": "^2.6",
2727
"latte/latte": "^2.10.2 || ^3.0.12",
2828
"tracy/tracy": "^2.9",
29-
"phpstan/phpstan-nette": "^2.0@stable"
29+
"phpstan/phpstan": "^2.0@stable"
3030
},
3131
"conflict": {
3232
"latte/latte": ">=3.0.0 <3.0.12 || >=3.2"

phpstan-baseline.neon

Lines changed: 379 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,379 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '#^Using nullsafe property access on non\-nullable type Latte\\Compiler\\Nodes\\FragmentNode\. Use \-\> instead\.$#'
5+
identifier: nullsafe.neverNull
6+
count: 1
7+
path: src/Bridges/FormsLatte/Nodes/FieldNNameNode.php
8+
9+
-
10+
message: '#^Call to an undefined method Nette\\Forms\\Control\:\:getControl\(\)\.$#'
11+
identifier: method.notFound
12+
count: 1
13+
path: src/Bridges/FormsLatte/Runtime.php
14+
15+
-
16+
message: '#^Call to an undefined method Nette\\Forms\\Control\:\:getOption\(\)\.$#'
17+
identifier: method.notFound
18+
count: 2
19+
path: src/Bridges/FormsLatte/Runtime.php
20+
21+
-
22+
message: '#^Call to an undefined method Nette\\Forms\\Control\:\:setOption\(\)\.$#'
23+
identifier: method.notFound
24+
count: 1
25+
path: src/Bridges/FormsLatte/Runtime.php
26+
27+
-
28+
message: '#^Call to an undefined method Nette\\Forms\\Control\:\:lookupPath\(\)\.$#'
29+
identifier: method.notFound
30+
count: 1
31+
path: src/Forms/Blueprint.php
32+
33+
-
34+
message: '#^Method Nette\\Forms\\Controls\\BaseControl@anonymous/src/Forms/Blueprint\.php\:97\:\:getControl\(\) never returns Nette\\Utils\\Html so it can be removed from the return type\.$#'
35+
identifier: return.unusedType
36+
count: 1
37+
path: src/Forms/Blueprint.php
38+
39+
-
40+
message: '#^Method Nette\\Forms\\Controls\\BaseControl@anonymous/src/Forms/Blueprint\.php\:97\:\:getLabel\(\) never returns Nette\\Utils\\Html so it can be removed from the return type\.$#'
41+
identifier: return.unusedType
42+
count: 1
43+
path: src/Forms/Blueprint.php
44+
45+
-
46+
message: '#^Method Nette\\Forms\\Form@anonymous/src/Forms/Blueprint\.php\:89\:\:receiveHttpData\(\) never returns null so it can be removed from the return type\.$#'
47+
identifier: return.unusedType
48+
count: 1
49+
path: src/Forms/Blueprint.php
50+
51+
-
52+
message: '#^Property Nette\\Forms\\Controls\\BaseControl@anonymous/src/Forms/Blueprint\.php\:97\:\:\$inner has no type specified\.$#'
53+
identifier: missingType.property
54+
count: 1
55+
path: src/Forms/Blueprint.php
56+
57+
-
58+
message: '#^Call to an undefined method Nette\\ComponentModel\\IComponent&Nette\\Forms\\Control\:\:isDisabled\(\)\.$#'
59+
identifier: method.notFound
60+
count: 1
61+
path: src/Forms/Container.php
62+
63+
-
64+
message: '#^Method Nette\\Forms\\Container\:\:extensionMethod\(\) has parameter \$callback with no type specified\.$#'
65+
identifier: missingType.parameter
66+
count: 1
67+
path: src/Forms/Container.php
68+
69+
-
70+
message: '#^Method Nette\\Forms\\Container\:\:getUnsafeValues\(\) has no return type specified\.$#'
71+
identifier: missingType.return
72+
count: 1
73+
path: src/Forms/Container.php
74+
75+
-
76+
message: '#^Method Nette\\Forms\\Container\:\:getUnsafeValues\(\) has parameter \$controls with no value type specified in iterable type array\.$#'
77+
identifier: missingType.iterableValue
78+
count: 1
79+
path: src/Forms/Container.php
80+
81+
-
82+
message: '#^Method Nette\\Forms\\Container\:\:getUnsafeValues\(\) has parameter \$returnType with no type specified\.$#'
83+
identifier: missingType.parameter
84+
count: 1
85+
path: src/Forms/Container.php
86+
87+
-
88+
message: '#^Parameter \#1 \.\.\.\$items of method Nette\\Forms\\ControlGroup\:\:add\(\) expects iterable\<Nette\\Forms\\Container\|Nette\\Forms\\Control\>\|Nette\\Forms\\Container\|Nette\\Forms\\Control, Nette\\ComponentModel\\IComponent given\.$#'
89+
identifier: argument.type
90+
count: 1
91+
path: src/Forms/Container.php
92+
93+
-
94+
message: '#^Unable to resolve the template type T in call to method Nette\\Forms\\Container\:\:getUntrustedValues\(\)$#'
95+
identifier: argument.templateType
96+
count: 1
97+
path: src/Forms/Container.php
98+
99+
-
100+
message: '#^Call to an undefined method Nette\\Forms\\Control\:\:getForm\(\)\.$#'
101+
identifier: method.notFound
102+
count: 1
103+
path: src/Forms/ControlGroup.php
104+
105+
-
106+
message: '#^Call to function is_iterable\(\) with iterable\<Nette\\Forms\\Container\|Nette\\Forms\\Control\> will always evaluate to true\.$#'
107+
identifier: function.alreadyNarrowedType
108+
count: 1
109+
path: src/Forms/ControlGroup.php
110+
111+
-
112+
message: '#^Parameter \#1 \.\.\.\$items of method Nette\\Forms\\ControlGroup\:\:add\(\) expects iterable\<Nette\\Forms\\Container\|Nette\\Forms\\Control\>\|Nette\\Forms\\Container\|Nette\\Forms\\Control, Nette\\ComponentModel\\IComponent given\.$#'
113+
identifier: argument.type
114+
count: 1
115+
path: src/Forms/ControlGroup.php
116+
117+
-
118+
message: '#^Method Nette\\Forms\\Controls\\BaseControl\:\:extensionMethod\(\) has parameter \$callback with no type specified\.$#'
119+
identifier: missingType.parameter
120+
count: 1
121+
path: src/Forms/Controls/BaseControl.php
122+
123+
-
124+
message: '#^Method Nette\\Forms\\Controls\\BaseControl\:\:getHttpData\(\) has parameter \$type with no type specified\.$#'
125+
identifier: missingType.parameter
126+
count: 1
127+
path: src/Forms/Controls/BaseControl.php
128+
129+
-
130+
message: '#^Method Nette\\Forms\\Controls\\BaseControl\:\:getOption\(\) has parameter \$key with no type specified\.$#'
131+
identifier: missingType.parameter
132+
count: 1
133+
path: src/Forms/Controls/BaseControl.php
134+
135+
-
136+
message: '#^Method Nette\\Forms\\Controls\\BaseControl\:\:setOption\(\) has parameter \$key with no type specified\.$#'
137+
identifier: missingType.parameter
138+
count: 1
139+
path: src/Forms/Controls/BaseControl.php
140+
141+
-
142+
message: '#^Method Nette\\Forms\\Controls\\Button\:\:getLabel\(\) has parameter \$caption with no type specified\.$#'
143+
identifier: missingType.parameter
144+
count: 1
145+
path: src/Forms/Controls/Button.php
146+
147+
-
148+
message: '#^Method Nette\\Forms\\Controls\\Checkbox\:\:getLabel\(\) has parameter \$caption with no type specified\.$#'
149+
identifier: missingType.parameter
150+
count: 1
151+
path: src/Forms/Controls/Checkbox.php
152+
153+
-
154+
message: '#^Method Nette\\Forms\\Controls\\CheckboxList\:\:getControlPart\(\) has parameter \$key with no type specified\.$#'
155+
identifier: missingType.parameter
156+
count: 1
157+
path: src/Forms/Controls/CheckboxList.php
158+
159+
-
160+
message: '#^Method Nette\\Forms\\Controls\\CheckboxList\:\:getLabel\(\) has parameter \$caption with no type specified\.$#'
161+
identifier: missingType.parameter
162+
count: 1
163+
path: src/Forms/Controls/CheckboxList.php
164+
165+
-
166+
message: '#^Method Nette\\Forms\\Controls\\CheckboxList\:\:getLabelPart\(\) has parameter \$key with no type specified\.$#'
167+
identifier: missingType.parameter
168+
count: 1
169+
path: src/Forms/Controls/CheckboxList.php
170+
171+
-
172+
message: '#^Call to function is_string\(\) with string will always evaluate to true\.$#'
173+
identifier: function.alreadyNarrowedType
174+
count: 1
175+
path: src/Forms/Controls/ColorPicker.php
176+
177+
-
178+
message: '#^Match expression does not handle remaining values\: int\<min, 0\>\|int\<4, max\>$#'
179+
identifier: match.unhandled
180+
count: 4
181+
path: src/Forms/Controls/DateTimeControl.php
182+
183+
-
184+
message: '#^Method Nette\\Forms\\Controls\\HiddenField\:\:getLabel\(\) has parameter \$caption with no type specified\.$#'
185+
identifier: missingType.parameter
186+
count: 1
187+
path: src/Forms/Controls/HiddenField.php
188+
189+
-
190+
message: '#^Method Nette\\Forms\\Controls\\RadioList\:\:getControlPart\(\) has parameter \$key with no type specified\.$#'
191+
identifier: missingType.parameter
192+
count: 1
193+
path: src/Forms/Controls/RadioList.php
194+
195+
-
196+
message: '#^Method Nette\\Forms\\Controls\\RadioList\:\:getLabel\(\) has parameter \$caption with no type specified\.$#'
197+
identifier: missingType.parameter
198+
count: 1
199+
path: src/Forms/Controls/RadioList.php
200+
201+
-
202+
message: '#^Method Nette\\Forms\\Controls\\RadioList\:\:getLabelPart\(\) has parameter \$key with no type specified\.$#'
203+
identifier: missingType.parameter
204+
count: 1
205+
path: src/Forms/Controls/RadioList.php
206+
207+
-
208+
message: '#^Method Nette\\Forms\\Controls\\SubmitButton\:\:getControl\(\) has parameter \$caption with no type specified\.$#'
209+
identifier: missingType.parameter
210+
count: 1
211+
path: src/Forms/Controls/SubmitButton.php
212+
213+
-
214+
message: '#^Call to an undefined method Nette\\ComponentModel\\IComponent\:\:getValue\(\)\.$#'
215+
identifier: method.notFound
216+
count: 1
217+
path: src/Forms/Form.php
218+
219+
-
220+
message: '#^Call to an undefined method Nette\\Forms\\Control\:\:getParent\(\)\.$#'
221+
identifier: method.notFound
222+
count: 1
223+
path: src/Forms/Form.php
224+
225+
-
226+
message: '#^Method Nette\\Forms\\Form\:\:beforeRender\(\) has no return type specified\.$#'
227+
identifier: missingType.return
228+
count: 1
229+
path: src/Forms/Form.php
230+
231+
-
232+
message: '#^Method Nette\\Forms\\Form\:\:invokeHandlers\(\) has parameter \$handlers with no signature specified for callable\.$#'
233+
identifier: missingType.callable
234+
count: 1
235+
path: src/Forms/Form.php
236+
237+
-
238+
message: '#^Call to an undefined method Nette\\Forms\\Control\:\:getHtmlName\(\)\.$#'
239+
identifier: method.notFound
240+
count: 2
241+
path: src/Forms/Helpers.php
242+
243+
-
244+
message: '#^Method Nette\\Forms\\Helpers\:\:sanitize\(\) never returns array\<mixed\> so it can be removed from the return type\.$#'
245+
identifier: return.unusedType
246+
count: 1
247+
path: src/Forms/Helpers.php
248+
249+
-
250+
message: '#^Parameter \#1 \$callback of function array_map expects \(callable\(Nette\\Utils\\ImageType\)\: mixed\)\|null, Closure\(1\|2\|3\|6\|18\|19\)\: string given\.$#'
251+
identifier: argument.type
252+
count: 1
253+
path: src/Forms/Helpers.php
254+
255+
-
256+
message: '#^Strict comparison using \=\=\= between '''' and '''' will always evaluate to true\.$#'
257+
identifier: identical.alwaysTrue
258+
count: 1
259+
path: src/Forms/Helpers.php
260+
261+
-
262+
message: '#^Call to an undefined method Nette\\Forms\\Control\:\:getControl\(\)\.$#'
263+
identifier: method.notFound
264+
count: 2
265+
path: src/Forms/Rendering/DefaultFormRenderer.php
266+
267+
-
268+
message: '#^Call to an undefined method Nette\\Forms\\Control\:\:getForm\(\)\.$#'
269+
identifier: method.notFound
270+
count: 2
271+
path: src/Forms/Rendering/DefaultFormRenderer.php
272+
273+
-
274+
message: '#^Call to an undefined method Nette\\Forms\\Control\:\:getLabel\(\)\.$#'
275+
identifier: method.notFound
276+
count: 1
277+
path: src/Forms/Rendering/DefaultFormRenderer.php
278+
279+
-
280+
message: '#^Call to an undefined method Nette\\Forms\\Control\:\:getOption\(\)\.$#'
281+
identifier: method.notFound
282+
count: 12
283+
path: src/Forms/Rendering/DefaultFormRenderer.php
284+
285+
-
286+
message: '#^Call to an undefined method Nette\\Forms\\Control\:\:hasErrors\(\)\.$#'
287+
identifier: method.notFound
288+
count: 3
289+
path: src/Forms/Rendering/DefaultFormRenderer.php
290+
291+
-
292+
message: '#^Call to an undefined method Nette\\Forms\\Control\:\:isRequired\(\)\.$#'
293+
identifier: method.notFound
294+
count: 4
295+
path: src/Forms/Rendering/DefaultFormRenderer.php
296+
297+
-
298+
message: '#^Call to an undefined method Nette\\Forms\\Control\:\:setOption\(\)\.$#'
299+
identifier: method.notFound
300+
count: 3
301+
path: src/Forms/Rendering/DefaultFormRenderer.php
302+
303+
-
304+
message: '#^Instanceof between Nette\\Forms\\Control and Nette\\Forms\\Control will always evaluate to true\.$#'
305+
identifier: instanceof.alwaysTrue
306+
count: 1
307+
path: src/Forms/Rendering/DefaultFormRenderer.php
308+
309+
-
310+
message: '#^Instanceof between string and Nette\\HtmlStringable will always evaluate to false\.$#'
311+
identifier: instanceof.alwaysFalse
312+
count: 1
313+
path: src/Forms/Rendering/DefaultFormRenderer.php
314+
315+
-
316+
message: '#^Variable \$control might not be defined\.$#'
317+
identifier: variable.undefined
318+
count: 1
319+
path: src/Forms/Rendering/DefaultFormRenderer.php
320+
321+
-
322+
message: '#^Access to an undefined property Nette\\Forms\\Control\:\:\$name\.$#'
323+
identifier: property.notFound
324+
count: 1
325+
path: src/Forms/Rules.php
326+
327+
-
328+
message: '#^Call to an undefined method Nette\\Forms\\Control\:\:addError\(\)\.$#'
329+
identifier: method.notFound
330+
count: 1
331+
path: src/Forms/Rules.php
332+
333+
-
334+
message: '#^Call to an undefined method Nette\\Forms\\Control\:\:isFilled\(\)\.$#'
335+
identifier: method.notFound
336+
count: 2
337+
path: src/Forms/Rules.php
338+
339+
-
340+
message: '#^Method Nette\\Forms\\Rules\:\:getCallback\(\) return type has no signature specified for callable\.$#'
341+
identifier: missingType.callable
342+
count: 1
343+
path: src/Forms/Rules.php
344+
345+
-
346+
message: '#^Method Nette\\Forms\\Rules\:\:getCallback\(\) return type has no value type specified in iterable type array\.$#'
347+
identifier: missingType.iterableValue
348+
count: 1
349+
path: src/Forms/Rules.php
350+
351+
-
352+
message: '#^Call to an undefined method Nette\\Forms\\Control\:\:getForm\(\)\.$#'
353+
identifier: method.notFound
354+
count: 1
355+
path: src/Forms/Validator.php
356+
357+
-
358+
message: '#^Call to an undefined method Nette\\Forms\\Control\:\:getName\(\)\.$#'
359+
identifier: method.notFound
360+
count: 2
361+
path: src/Forms/Validator.php
362+
363+
-
364+
message: '#^Call to an undefined method Nette\\HtmlStringable\:\:getText\(\)\.$#'
365+
identifier: method.notFound
366+
count: 1
367+
path: src/Forms/Validator.php
368+
369+
-
370+
message: '#^Unable to resolve the template type T in call to method Nette\\Forms\\Container\:\:getUntrustedValues\(\)$#'
371+
identifier: argument.templateType
372+
count: 1
373+
path: tests/types/forms-types.php
374+
375+
-
376+
message: '#^Unable to resolve the template type T in call to method Nette\\Forms\\Container\:\:getValues\(\)$#'
377+
identifier: argument.templateType
378+
count: 1
379+
path: tests/types/forms-types.php

0 commit comments

Comments
 (0)