Skip to content

Commit 13d7146

Browse files
committed
[TASK] Raise PHPStan to level 7
https://phpstan.org/user-guide/rule-levels
1 parent 7f85aa8 commit 13d7146

2 files changed

Lines changed: 325 additions & 1 deletion

File tree

config/phpstan-baseline.neon

Lines changed: 324 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,41 @@
11
parameters:
22
ignoreErrors:
3+
-
4+
message: '#^Only booleans are allowed in an if condition, Sabberworm\\CSS\\CSSList\\CSSListItem\|false given\.$#'
5+
identifier: if.condNotBoolean
6+
count: 1
7+
path: ../src/CSSList/CSSList.php
8+
9+
-
10+
message: '#^Parameter \#1 \$animationName of method Sabberworm\\CSS\\CSSList\\KeyFrame\:\:setAnimationName\(\) expects non\-empty\-string, string given\.$#'
11+
identifier: argument.type
12+
count: 1
13+
path: ../src/CSSList/CSSList.php
14+
15+
-
16+
message: '#^Parameter \#1 \$selector of class Sabberworm\\CSS\\Property\\Selector constructor expects non\-empty\-list\<Sabberworm\\CSS\\Property\\Selector\\Component\>\|non\-empty\-string, string given\.$#'
17+
identifier: argument.type
18+
count: 1
19+
path: ../src/CSSList/CSSList.php
20+
321
-
422
message: '#^Parameter \#2 \$found of class Sabberworm\\CSS\\Parsing\\UnexpectedTokenException constructor expects string, Sabberworm\\CSS\\Value\\CSSFunction\|Sabberworm\\CSS\\Value\\CSSString\|Sabberworm\\CSS\\Value\\LineName\|Sabberworm\\CSS\\Value\\Size\|Sabberworm\\CSS\\Value\\URL given\.$#'
523
identifier: argument.type
624
count: 1
725
path: ../src/CSSList/CSSList.php
826

27+
-
28+
message: '#^Parameter \#2 \$found of class Sabberworm\\CSS\\Parsing\\UnexpectedTokenException constructor expects string, Sabberworm\\CSS\\Value\\CSSFunction\|Sabberworm\\CSS\\Value\\LineName\|Sabberworm\\CSS\\Value\\Size\|string given\.$#'
29+
identifier: argument.type
30+
count: 1
31+
path: ../src/CSSList/CSSList.php
32+
33+
-
34+
message: '#^Parameter \#2 \$selectors2 of static method Sabberworm\\CSS\\CSSList\\CSSList\:\:selectorsMatch\(\) expects list\<Sabberworm\\CSS\\Property\\Selector\>, array\<Sabberworm\\CSS\\Property\\Selector\|string\> given\.$#'
35+
identifier: argument.type
36+
count: 1
37+
path: ../src/CSSList/CSSList.php
38+
939
-
1040
message: '#^Parameters should have "Sabberworm\\CSS\\CSSList\\CSSListItem\|array" types as the only types passed to this method$#'
1141
identifier: typePerfect.narrowPublicClassMethodParamType
@@ -18,24 +48,138 @@ parameters:
1848
count: 1
1949
path: ../src/CSSList/Document.php
2050

51+
-
52+
message: '#^Method Sabberworm\\CSS\\Comment\\Comment\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
53+
identifier: return.type
54+
count: 1
55+
path: ../src/Comment/Comment.php
56+
57+
-
58+
message: '#^Method Sabberworm\\CSS\\Parsing\\ParserState\:\:parseIdentifier\(\) should return non\-empty\-string but returns string\.$#'
59+
identifier: return.type
60+
count: 1
61+
path: ../src/Parsing/ParserState.php
62+
63+
-
64+
message: '#^Method Sabberworm\\CSS\\Parsing\\ParserState\:\:strlen\(\) should return int\<0, max\> but returns int\<0, max\>\|false\.$#'
65+
identifier: return.type
66+
count: 1
67+
path: ../src/Parsing/ParserState.php
68+
2169
-
2270
message: '#^Negated boolean expression is always true\.$#'
2371
identifier: booleanNot.alwaysTrue
2472
count: 1
2573
path: ../src/Parsing/ParserState.php
2674

75+
-
76+
message: '#^Property Sabberworm\\CSS\\Parsing\\ParserState\:\:\$currentPosition \(int\<0, max\>\) does not accept int\.$#'
77+
identifier: assign.propertyType
78+
count: 2
79+
path: ../src/Parsing/ParserState.php
80+
81+
-
82+
message: '#^Method Sabberworm\\CSS\\Property\\CSSNamespace\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
83+
identifier: return.type
84+
count: 1
85+
path: ../src/Property/CSSNamespace.php
86+
87+
-
88+
message: '#^Method Sabberworm\\CSS\\Property\\Charset\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
89+
identifier: return.type
90+
count: 1
91+
path: ../src/Property/Charset.php
92+
93+
-
94+
message: '#^Parameter \#1 \$separator of class Sabberworm\\CSS\\Value\\RuleValueList constructor expects non\-empty\-string, string given\.$#'
95+
identifier: argument.type
96+
count: 1
97+
path: ../src/Property/Declaration.php
98+
99+
-
100+
message: '#^Parameter \#1 \$value of method Sabberworm\\CSS\\Property\\Declaration\:\:setValue\(\) expects Sabberworm\\CSS\\Value\\RuleValueList\|string\|null, Sabberworm\\CSS\\Value\\Value\|string given\.$#'
101+
identifier: argument.type
102+
count: 1
103+
path: ../src/Property/Declaration.php
104+
105+
-
106+
message: '#^Method Sabberworm\\CSS\\Property\\Selector\:\:getSelector\(\) should return non\-empty\-string but returns string\.$#'
107+
identifier: return.type
108+
count: 1
109+
path: ../src/Property/Selector.php
110+
111+
-
112+
message: '#^Method Sabberworm\\CSS\\Property\\Selector\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
113+
identifier: return.type
114+
count: 1
115+
path: ../src/Property/Selector.php
116+
117+
-
118+
message: '#^Method Sabberworm\\CSS\\Property\\Selector\:\:parseComponents\(\) should return non\-empty\-list\<Sabberworm\\CSS\\Property\\Selector\\Component\> but returns list\<Sabberworm\\CSS\\Property\\Selector\\Combinator\|Sabberworm\\CSS\\Property\\Selector\\CompoundSelector\>\.$#'
119+
identifier: return.type
120+
count: 1
121+
path: ../src/Property/Selector.php
122+
123+
-
124+
message: '#^Method Sabberworm\\CSS\\Property\\Selector\\Combinator\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
125+
identifier: return.type
126+
count: 1
127+
path: ../src/Property/Selector/Combinator.php
128+
129+
-
130+
message: '#^Method Sabberworm\\CSS\\Property\\Selector\\CompoundSelector\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
131+
identifier: return.type
132+
count: 1
133+
path: ../src/Property/Selector/CompoundSelector.php
134+
135+
-
136+
message: '#^Parameter \#1 \$selector of class Sabberworm\\CSS\\Property\\KeyframeSelector constructor expects non\-empty\-list\<Sabberworm\\CSS\\Property\\Selector\\Component\>\|non\-empty\-string, string given\.$#'
137+
identifier: argument.type
138+
count: 1
139+
path: ../src/RuleSet/DeclarationBlock.php
140+
141+
-
142+
message: '#^Parameter \#1 \$selector of class Sabberworm\\CSS\\Property\\Selector constructor expects non\-empty\-list\<Sabberworm\\CSS\\Property\\Selector\\Component\>\|non\-empty\-string, string given\.$#'
143+
identifier: argument.type
144+
count: 1
145+
path: ../src/RuleSet/DeclarationBlock.php
146+
27147
-
28148
message: '#^Parameters should have "string" types as the only types passed to this method$#'
29149
identifier: typePerfect.narrowPublicClassMethodParamType
30150
count: 1
31151
path: ../src/RuleSet/DeclarationBlock.php
32152

153+
-
154+
message: '#^Property Sabberworm\\CSS\\RuleSet\\DeclarationBlock\:\:\$selectors \(list\<Sabberworm\\CSS\\Property\\Selector\>\) does not accept array\<int\<0, max\>, Sabberworm\\CSS\\Property\\Selector\>\.$#'
155+
identifier: assign.propertyType
156+
count: 1
157+
path: ../src/RuleSet/DeclarationBlock.php
158+
159+
-
160+
message: '#^Property Sabberworm\\CSS\\RuleSet\\DeclarationBlock\:\:\$selectors \(list\<Sabberworm\\CSS\\Property\\Selector\>\) does not accept list\<Sabberworm\\CSS\\Property\\Selector\|string\>\.$#'
161+
identifier: assign.propertyType
162+
count: 1
163+
path: ../src/RuleSet/DeclarationBlock.php
164+
165+
-
166+
message: '#^Parameter \#1 \$name of class Sabberworm\\CSS\\Value\\CSSFunction constructor expects non\-empty\-string, string given\.$#'
167+
identifier: argument.type
168+
count: 1
169+
path: ../src/Value/CSSFunction.php
170+
33171
-
34172
message: '#^Parameter \#2 \$arguments of class Sabberworm\\CSS\\Value\\CSSFunction constructor expects array\<Sabberworm\\CSS\\Value\\Value\|string\>\|Sabberworm\\CSS\\Value\\RuleValueList, Sabberworm\\CSS\\Value\\Value\|string given\.$#'
35173
identifier: argument.type
36174
count: 1
37175
path: ../src/Value/CSSFunction.php
38176

177+
-
178+
message: '#^Method Sabberworm\\CSS\\Value\\CSSString\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
179+
identifier: return.type
180+
count: 1
181+
path: ../src/Value/CSSString.php
182+
39183
-
40184
message: '#^Parameter \#2 \$offset of method Sabberworm\\CSS\\Parsing\\ParserState\:\:peek\(\) expects int\<0, max\>, \-1 given\.$#'
41185
identifier: argument.type
@@ -48,6 +192,30 @@ parameters:
48192
count: 3
49193
path: ../src/Value/Color.php
50194

195+
-
196+
message: '#^Parameter \#1 \$name of method Sabberworm\\CSS\\Value\\CSSFunction\:\:__construct\(\) expects non\-empty\-string, string given\.$#'
197+
identifier: argument.type
198+
count: 1
199+
path: ../src/Value/Color.php
200+
201+
-
202+
message: '#^Parameter \#1 \$name of method Sabberworm\\CSS\\Value\\CSSFunction\:\:setName\(\) expects non\-empty\-string, string given\.$#'
203+
identifier: argument.type
204+
count: 1
205+
path: ../src/Value/Color.php
206+
207+
-
208+
message: '#^Method Sabberworm\\CSS\\Value\\Size\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
209+
identifier: return.type
210+
count: 1
211+
path: ../src/Value/Size.php
212+
213+
-
214+
message: '#^Method Sabberworm\\CSS\\Value\\Size\:\:render\(\) should return non\-empty\-string but returns string\.$#'
215+
identifier: return.type
216+
count: 1
217+
path: ../src/Value/Size.php
218+
51219
-
52220
message: '#^Parameters should have "float" types as the only types passed to this method$#'
53221
identifier: typePerfect.narrowPublicClassMethodParamType
@@ -60,6 +228,30 @@ parameters:
60228
count: 1
61229
path: ../src/Value/Size.php
62230

231+
-
232+
message: '#^Method Sabberworm\\CSS\\Value\\URL\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
233+
identifier: return.type
234+
count: 1
235+
path: ../src/Value/URL.php
236+
237+
-
238+
message: '#^Method Sabberworm\\CSS\\Value\\Value\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
239+
identifier: return.type
240+
count: 1
241+
path: ../src/Value/Value.php
242+
243+
-
244+
message: '#^Method Sabberworm\\CSS\\Value\\Value\:\:parseIdentifierOrFunction\(\) should return Sabberworm\\CSS\\Value\\CSSFunction\|string but returns Sabberworm\\CSS\\Value\\CSSFunction\|Sabberworm\\CSS\\Value\\URL\|string\.$#'
245+
identifier: return.type
246+
count: 1
247+
path: ../src/Value/Value.php
248+
249+
-
250+
message: '#^Parameter \#1 \$name of class Sabberworm\\CSS\\Value\\CSSFunction constructor expects non\-empty\-string, string given\.$#'
251+
identifier: argument.type
252+
count: 1
253+
path: ../src/Value/Value.php
254+
63255
-
64256
message: '#^Parameter \#2 \$arguments of class Sabberworm\\CSS\\Value\\CSSFunction constructor expects array\<Sabberworm\\CSS\\Value\\Value\|string\>\|Sabberworm\\CSS\\Value\\RuleValueList, Sabberworm\\CSS\\Value\\Value\|string given\.$#'
65257
identifier: argument.type
@@ -72,12 +264,42 @@ parameters:
72264
count: 1
73265
path: ../src/Value/Value.php
74266

267+
-
268+
message: '#^Method Sabberworm\\CSS\\Value\\ValueList\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
269+
identifier: return.type
270+
count: 1
271+
path: ../src/Value/ValueList.php
272+
273+
-
274+
message: '#^Parameter \#1 \$propertyName of class Sabberworm\\CSS\\Property\\Declaration constructor expects non\-empty\-string, string given\.$#'
275+
identifier: argument.type
276+
count: 1
277+
path: ../tests/Functional/RuleSet/RuleSetTest.php
278+
75279
-
76280
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertSame\(\) with ''red'' and Sabberworm\\CSS\\Value\\Value will always evaluate to false\.$#'
77281
identifier: staticMethod.impossibleType
78282
count: 1
79283
path: ../tests/ParserTest.php
80284

285+
-
286+
message: '#^Cannot call method getListComponents\(\) on Sabberworm\\CSS\\Value\\RuleValueList\|string\.$#'
287+
identifier: method.nonObject
288+
count: 2
289+
path: ../tests/ParserTest.php
290+
291+
-
292+
message: '#^Cannot call method getListSeparator\(\) on Sabberworm\\CSS\\Value\\RuleValueList\|string\.$#'
293+
identifier: method.nonObject
294+
count: 2
295+
path: ../tests/ParserTest.php
296+
297+
-
298+
message: '#^Cannot call method render\(\) on Sabberworm\\CSS\\Value\\RuleValueList\|string\.$#'
299+
identifier: method.nonObject
300+
count: 1
301+
path: ../tests/ParserTest.php
302+
81303
-
82304
message: '#^Parameter \#1 \$value of method Sabberworm\\CSS\\Property\\Declaration\:\:setValue\(\) expects Sabberworm\\CSS\\Value\\RuleValueList\|string\|null, Sabberworm\\CSS\\Value\\Size given\.$#'
83305
identifier: argument.type
@@ -107,3 +329,105 @@ parameters:
107329
identifier: argument.type
108330
count: 2
109331
path: ../tests/Unit/CSSList/CSSListTest.php
332+
333+
-
334+
message: '#^Method Sabberworm\\CSS\\Tests\\Unit\\Comment\\CommentContainerTest\:\:provideAlternativeNonemptyCommentArray\(\) should return array\<non\-empty\-string, array\{non\-empty\-list\<Sabberworm\\CSS\\Comment\\Comment\>\}\> but returns array\<non\-empty\-string, array\{list\<Sabberworm\\CSS\\Comment\\Comment\>\}\>\.$#'
335+
identifier: return.type
336+
count: 1
337+
path: ../tests/Unit/Comment/CommentContainerTest.php
338+
339+
-
340+
message: '#^Method Sabberworm\\CSS\\Tests\\Unit\\Fixtures\\ConcreteShortClassNameProvider\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
341+
identifier: return.type
342+
count: 1
343+
path: ../tests/Unit/Fixtures/ConcreteShortClassNameProvider.php
344+
345+
-
346+
message: '#^Parameter \#1 \$numberOfSpaces of method Sabberworm\\CSS\\OutputFormat\:\:indentWithSpaces\(\) expects int\<1, max\>, int given\.$#'
347+
identifier: argument.type
348+
count: 1
349+
path: ../tests/Unit/OutputFormatTest.php
350+
351+
-
352+
message: '#^Parameter \#1 \$numberOfTabs of method Sabberworm\\CSS\\OutputFormat\:\:indentWithTabs\(\) expects int\<1, max\>, int given\.$#'
353+
identifier: argument.type
354+
count: 1
355+
path: ../tests/Unit/OutputFormatTest.php
356+
357+
-
358+
message: '#^Parameter \#1 \$lineNumber of method Sabberworm\\CSS\\Tests\\Unit\\Position\\Fixtures\\ConcretePosition\:\:setPosition\(\) expects int\<1, max\>\|null, int given\.$#'
359+
identifier: argument.type
360+
count: 2
361+
path: ../tests/Unit/Position/PositionTest.php
362+
363+
-
364+
message: '#^Parameter \#2 \$columnNumber of method Sabberworm\\CSS\\Tests\\Unit\\Position\\Fixtures\\ConcretePosition\:\:setPosition\(\) expects int\<0, max\>\|null, int given\.$#'
365+
identifier: argument.type
366+
count: 3
367+
path: ../tests/Unit/Position/PositionTest.php
368+
369+
-
370+
message: '#^Cannot access offset 0 on array\<mixed\>\|bool\|float\|int\|string\|null\.$#'
371+
identifier: offsetAccess.nonOffsetAccessible
372+
count: 1
373+
path: ../tests/Unit/Property/KeyframeSelectorTest.php
374+
375+
-
376+
message: '#^Parameter \#1 \$value of class Sabberworm\\CSS\\Property\\Selector\\Combinator constructor expects '' ''\|''\+''\|''\>''\|''~'', non\-empty\-string given\.$#'
377+
identifier: argument.type
378+
count: 1
379+
path: ../tests/Unit/Property/Selector/CombinatorTest.php
380+
381+
-
382+
message: '#^Cannot access offset 0 on array\<mixed\>\|bool\|float\|int\|string\|null\.$#'
383+
identifier: offsetAccess.nonOffsetAccessible
384+
count: 1
385+
path: ../tests/Unit/Property/SelectorTest.php
386+
387+
-
388+
message: '#^Parameter \#1 \$selector of class Sabberworm\\CSS\\Property\\Selector constructor expects non\-empty\-list\<Sabberworm\\CSS\\Property\\Selector\\Component\>\|non\-empty\-string, string given\.$#'
389+
identifier: argument.type
390+
count: 1
391+
path: ../tests/Unit/Property/SelectorTest.php
392+
393+
-
394+
message: '#^Parameter \#1 \$selector of method Sabberworm\\CSS\\Property\\Selector\:\:setSelector\(\) expects non\-empty\-string, string given\.$#'
395+
identifier: argument.type
396+
count: 1
397+
path: ../tests/Unit/Property/SelectorTest.php
398+
399+
-
400+
message: '#^Parameter \#1 \$propertyName of class Sabberworm\\CSS\\Property\\Declaration constructor expects non\-empty\-string, string given\.$#'
401+
identifier: argument.type
402+
count: 19
403+
path: ../tests/Unit/RuleSet/DeclarationBlockTest.php
404+
405+
-
406+
message: '#^Parameter \#1 \$propertyName of class Sabberworm\\CSS\\Property\\Declaration constructor expects non\-empty\-string, string given\.$#'
407+
identifier: argument.type
408+
count: 19
409+
path: ../tests/Unit/RuleSet/RuleSetTest.php
410+
411+
-
412+
message: '#^Cannot access offset 0 on array\<mixed\>\|bool\|float\|int\|string\|null\.$#'
413+
identifier: offsetAccess.nonOffsetAccessible
414+
count: 3
415+
path: ../tests/Unit/Value/ValueListTest.php
416+
417+
-
418+
message: '#^Cannot access offset 1 on array\<mixed\>\|bool\|float\|int\|string\|null\.$#'
419+
identifier: offsetAccess.nonOffsetAccessible
420+
count: 1
421+
path: ../tests/Unit/Value/ValueListTest.php
422+
423+
-
424+
message: '#^Cannot access offset 2 on array\<mixed\>\|bool\|float\|int\|string\|null\.$#'
425+
identifier: offsetAccess.nonOffsetAccessible
426+
count: 1
427+
path: ../tests/Unit/Value/ValueListTest.php
428+
429+
-
430+
message: '#^Cannot call method getArrayRepresentation\(\) on Sabberworm\\CSS\\Value\\Value\|string\.$#'
431+
identifier: method.nonObject
432+
count: 1
433+
path: ../tests/Unit/Value/ValueTest.php

0 commit comments

Comments
 (0)