Skip to content

Commit 7c4f704

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

2 files changed

Lines changed: 331 additions & 1 deletion

File tree

config/phpstan-baseline.neon

Lines changed: 330 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,144 @@ 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\\Import\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
107+
identifier: return.type
108+
count: 1
109+
path: ../src/Property/Import.php
110+
111+
-
112+
message: '#^Method Sabberworm\\CSS\\Property\\Selector\:\:getSelector\(\) 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\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
119+
identifier: return.type
120+
count: 1
121+
path: ../src/Property/Selector.php
122+
123+
-
124+
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\>\.$#'
125+
identifier: return.type
126+
count: 1
127+
path: ../src/Property/Selector.php
128+
129+
-
130+
message: '#^Method Sabberworm\\CSS\\Property\\Selector\\Combinator\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
131+
identifier: return.type
132+
count: 1
133+
path: ../src/Property/Selector/Combinator.php
134+
135+
-
136+
message: '#^Method Sabberworm\\CSS\\Property\\Selector\\CompoundSelector\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
137+
identifier: return.type
138+
count: 1
139+
path: ../src/Property/Selector/CompoundSelector.php
140+
141+
-
142+
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\.$#'
143+
identifier: argument.type
144+
count: 1
145+
path: ../src/RuleSet/DeclarationBlock.php
146+
147+
-
148+
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\.$#'
149+
identifier: argument.type
150+
count: 1
151+
path: ../src/RuleSet/DeclarationBlock.php
152+
27153
-
28154
message: '#^Parameters should have "string" types as the only types passed to this method$#'
29155
identifier: typePerfect.narrowPublicClassMethodParamType
30156
count: 1
31157
path: ../src/RuleSet/DeclarationBlock.php
32158

159+
-
160+
message: '#^Property Sabberworm\\CSS\\RuleSet\\DeclarationBlock\:\:\$selectors \(list\<Sabberworm\\CSS\\Property\\Selector\>\) does not accept array\<int\<0, max\>, Sabberworm\\CSS\\Property\\Selector\>\.$#'
161+
identifier: assign.propertyType
162+
count: 1
163+
path: ../src/RuleSet/DeclarationBlock.php
164+
165+
-
166+
message: '#^Property Sabberworm\\CSS\\RuleSet\\DeclarationBlock\:\:\$selectors \(list\<Sabberworm\\CSS\\Property\\Selector\>\) does not accept list\<Sabberworm\\CSS\\Property\\Selector\|string\>\.$#'
167+
identifier: assign.propertyType
168+
count: 1
169+
path: ../src/RuleSet/DeclarationBlock.php
170+
171+
-
172+
message: '#^Parameter \#1 \$name of class Sabberworm\\CSS\\Value\\CSSFunction constructor expects non\-empty\-string, string given\.$#'
173+
identifier: argument.type
174+
count: 1
175+
path: ../src/Value/CSSFunction.php
176+
33177
-
34178
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\.$#'
35179
identifier: argument.type
36180
count: 1
37181
path: ../src/Value/CSSFunction.php
38182

183+
-
184+
message: '#^Method Sabberworm\\CSS\\Value\\CSSString\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
185+
identifier: return.type
186+
count: 1
187+
path: ../src/Value/CSSString.php
188+
39189
-
40190
message: '#^Parameter \#2 \$offset of method Sabberworm\\CSS\\Parsing\\ParserState\:\:peek\(\) expects int\<0, max\>, \-1 given\.$#'
41191
identifier: argument.type
@@ -48,6 +198,30 @@ parameters:
48198
count: 3
49199
path: ../src/Value/Color.php
50200

201+
-
202+
message: '#^Parameter \#1 \$name of method Sabberworm\\CSS\\Value\\CSSFunction\:\:__construct\(\) expects non\-empty\-string, string given\.$#'
203+
identifier: argument.type
204+
count: 1
205+
path: ../src/Value/Color.php
206+
207+
-
208+
message: '#^Parameter \#1 \$name of method Sabberworm\\CSS\\Value\\CSSFunction\:\:setName\(\) expects non\-empty\-string, string given\.$#'
209+
identifier: argument.type
210+
count: 1
211+
path: ../src/Value/Color.php
212+
213+
-
214+
message: '#^Method Sabberworm\\CSS\\Value\\Size\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
215+
identifier: return.type
216+
count: 1
217+
path: ../src/Value/Size.php
218+
219+
-
220+
message: '#^Method Sabberworm\\CSS\\Value\\Size\:\:render\(\) should return non\-empty\-string but returns string\.$#'
221+
identifier: return.type
222+
count: 1
223+
path: ../src/Value/Size.php
224+
51225
-
52226
message: '#^Parameters should have "float" types as the only types passed to this method$#'
53227
identifier: typePerfect.narrowPublicClassMethodParamType
@@ -60,6 +234,30 @@ parameters:
60234
count: 1
61235
path: ../src/Value/Size.php
62236

237+
-
238+
message: '#^Method Sabberworm\\CSS\\Value\\URL\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
239+
identifier: return.type
240+
count: 1
241+
path: ../src/Value/URL.php
242+
243+
-
244+
message: '#^Method Sabberworm\\CSS\\Value\\Value\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
245+
identifier: return.type
246+
count: 1
247+
path: ../src/Value/Value.php
248+
249+
-
250+
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\.$#'
251+
identifier: return.type
252+
count: 1
253+
path: ../src/Value/Value.php
254+
255+
-
256+
message: '#^Parameter \#1 \$name of class Sabberworm\\CSS\\Value\\CSSFunction constructor expects non\-empty\-string, string given\.$#'
257+
identifier: argument.type
258+
count: 1
259+
path: ../src/Value/Value.php
260+
63261
-
64262
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\.$#'
65263
identifier: argument.type
@@ -72,12 +270,42 @@ parameters:
72270
count: 1
73271
path: ../src/Value/Value.php
74272

273+
-
274+
message: '#^Method Sabberworm\\CSS\\Value\\ValueList\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
275+
identifier: return.type
276+
count: 1
277+
path: ../src/Value/ValueList.php
278+
279+
-
280+
message: '#^Parameter \#1 \$propertyName of class Sabberworm\\CSS\\Property\\Declaration constructor expects non\-empty\-string, string given\.$#'
281+
identifier: argument.type
282+
count: 1
283+
path: ../tests/Functional/RuleSet/RuleSetTest.php
284+
75285
-
76286
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertSame\(\) with ''red'' and Sabberworm\\CSS\\Value\\Value will always evaluate to false\.$#'
77287
identifier: staticMethod.impossibleType
78288
count: 1
79289
path: ../tests/ParserTest.php
80290

291+
-
292+
message: '#^Cannot call method getListComponents\(\) 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 getListSeparator\(\) on Sabberworm\\CSS\\Value\\RuleValueList\|string\.$#'
299+
identifier: method.nonObject
300+
count: 2
301+
path: ../tests/ParserTest.php
302+
303+
-
304+
message: '#^Cannot call method render\(\) on Sabberworm\\CSS\\Value\\RuleValueList\|string\.$#'
305+
identifier: method.nonObject
306+
count: 1
307+
path: ../tests/ParserTest.php
308+
81309
-
82310
message: '#^Parameter \#1 \$value of method Sabberworm\\CSS\\Property\\Declaration\:\:setValue\(\) expects Sabberworm\\CSS\\Value\\RuleValueList\|string\|null, Sabberworm\\CSS\\Value\\Size given\.$#'
83311
identifier: argument.type
@@ -107,3 +335,105 @@ parameters:
107335
identifier: argument.type
108336
count: 2
109337
path: ../tests/Unit/CSSList/CSSListTest.php
338+
339+
-
340+
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\>\}\>\.$#'
341+
identifier: return.type
342+
count: 1
343+
path: ../tests/Unit/Comment/CommentContainerTest.php
344+
345+
-
346+
message: '#^Method Sabberworm\\CSS\\Tests\\Unit\\Fixtures\\ConcreteShortClassNameProvider\:\:getShortClassName\(\) should return non\-empty\-string but returns string\.$#'
347+
identifier: return.type
348+
count: 1
349+
path: ../tests/Unit/Fixtures/ConcreteShortClassNameProvider.php
350+
351+
-
352+
message: '#^Parameter \#1 \$numberOfSpaces of method Sabberworm\\CSS\\OutputFormat\:\:indentWithSpaces\(\) 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 \$numberOfTabs of method Sabberworm\\CSS\\OutputFormat\:\:indentWithTabs\(\) expects int\<1, max\>, int given\.$#'
359+
identifier: argument.type
360+
count: 1
361+
path: ../tests/Unit/OutputFormatTest.php
362+
363+
-
364+
message: '#^Parameter \#1 \$lineNumber of method Sabberworm\\CSS\\Tests\\Unit\\Position\\Fixtures\\ConcretePosition\:\:setPosition\(\) expects int\<1, max\>\|null, int given\.$#'
365+
identifier: argument.type
366+
count: 2
367+
path: ../tests/Unit/Position/PositionTest.php
368+
369+
-
370+
message: '#^Parameter \#2 \$columnNumber of method Sabberworm\\CSS\\Tests\\Unit\\Position\\Fixtures\\ConcretePosition\:\:setPosition\(\) expects int\<0, max\>\|null, int given\.$#'
371+
identifier: argument.type
372+
count: 3
373+
path: ../tests/Unit/Position/PositionTest.php
374+
375+
-
376+
message: '#^Cannot access offset 0 on array\<mixed\>\|bool\|float\|int\|string\|null\.$#'
377+
identifier: offsetAccess.nonOffsetAccessible
378+
count: 1
379+
path: ../tests/Unit/Property/KeyframeSelectorTest.php
380+
381+
-
382+
message: '#^Parameter \#1 \$value of class Sabberworm\\CSS\\Property\\Selector\\Combinator constructor expects '' ''\|''\+''\|''\>''\|''~'', non\-empty\-string given\.$#'
383+
identifier: argument.type
384+
count: 1
385+
path: ../tests/Unit/Property/Selector/CombinatorTest.php
386+
387+
-
388+
message: '#^Cannot access offset 0 on array\<mixed\>\|bool\|float\|int\|string\|null\.$#'
389+
identifier: offsetAccess.nonOffsetAccessible
390+
count: 1
391+
path: ../tests/Unit/Property/SelectorTest.php
392+
393+
-
394+
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\.$#'
395+
identifier: argument.type
396+
count: 1
397+
path: ../tests/Unit/Property/SelectorTest.php
398+
399+
-
400+
message: '#^Parameter \#1 \$selector of method Sabberworm\\CSS\\Property\\Selector\:\:setSelector\(\) expects non\-empty\-string, string given\.$#'
401+
identifier: argument.type
402+
count: 1
403+
path: ../tests/Unit/Property/SelectorTest.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/DeclarationBlockTest.php
410+
411+
-
412+
message: '#^Parameter \#1 \$propertyName of class Sabberworm\\CSS\\Property\\Declaration constructor expects non\-empty\-string, string given\.$#'
413+
identifier: argument.type
414+
count: 19
415+
path: ../tests/Unit/RuleSet/RuleSetTest.php
416+
417+
-
418+
message: '#^Cannot access offset 0 on array\<mixed\>\|bool\|float\|int\|string\|null\.$#'
419+
identifier: offsetAccess.nonOffsetAccessible
420+
count: 3
421+
path: ../tests/Unit/Value/ValueListTest.php
422+
423+
-
424+
message: '#^Cannot access offset 1 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 access offset 2 on array\<mixed\>\|bool\|float\|int\|string\|null\.$#'
431+
identifier: offsetAccess.nonOffsetAccessible
432+
count: 1
433+
path: ../tests/Unit/Value/ValueListTest.php
434+
435+
-
436+
message: '#^Cannot call method getArrayRepresentation\(\) on Sabberworm\\CSS\\Value\\Value\|string\.$#'
437+
identifier: method.nonObject
438+
count: 1
439+
path: ../tests/Unit/Value/ValueTest.php

0 commit comments

Comments
 (0)