Skip to content

Commit 7b5e4b7

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

2 files changed

Lines changed: 277 additions & 1 deletion

File tree

Build/phpstan/phpstan-baseline.neon

Lines changed: 276 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,125 @@
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+
39+
-
40+
message: '#^Method Sabberworm\\CSS\\Parsing\\ParserState\:\:parseIdentifier\(\) should return non\-empty\-string but returns string\.$#'
41+
identifier: return.type
42+
count: 1
43+
path: ../../src/Parsing/ParserState.php
44+
45+
-
46+
message: '#^Method Sabberworm\\CSS\\Parsing\\ParserState\:\:strlen\(\) should return int\<0, max\> but returns int\<0, max\>\|false\.$#'
47+
identifier: return.type
48+
count: 1
49+
path: ../../src/Parsing/ParserState.php
50+
951
-
1052
message: '#^Negated boolean expression is always true\.$#'
1153
identifier: booleanNot.alwaysTrue
1254
count: 1
1355
path: ../../src/Parsing/ParserState.php
1456

57+
-
58+
message: '#^Property Sabberworm\\CSS\\Parsing\\ParserState\:\:\$currentPosition \(int\<0, max\>\) does not accept int\.$#'
59+
identifier: assign.propertyType
60+
count: 2
61+
path: ../../src/Parsing/ParserState.php
62+
63+
-
64+
message: '#^Method Sabberworm\\CSS\\Property\\Declaration\:\:getArrayRepresentation\(\) should return array\<string, array\<mixed\>\|bool\|float\|int\|string\|null\> but returns array\<string, bool\|Sabberworm\\CSS\\Value\\RuleValueList\|string\|null\>\.$#'
65+
identifier: return.type
66+
count: 1
67+
path: ../../src/Property/Declaration.php
68+
69+
-
70+
message: '#^Parameter \#1 \$separator of class Sabberworm\\CSS\\Value\\RuleValueList constructor expects non\-empty\-string, string given\.$#'
71+
identifier: argument.type
72+
count: 1
73+
path: ../../src/Property/Declaration.php
74+
75+
-
76+
message: '#^Parameter \#1 \$value of method Sabberworm\\CSS\\Property\\Declaration\:\:setValue\(\) expects Sabberworm\\CSS\\Value\\RuleValueList\|string\|null, Sabberworm\\CSS\\Value\\Value\|string given\.$#'
77+
identifier: argument.type
78+
count: 1
79+
path: ../../src/Property/Declaration.php
80+
81+
-
82+
message: '#^Method Sabberworm\\CSS\\Property\\Selector\:\:getSelector\(\) should return non\-empty\-string but returns string\.$#'
83+
identifier: return.type
84+
count: 1
85+
path: ../../src/Property/Selector.php
86+
87+
-
88+
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\>\.$#'
89+
identifier: return.type
90+
count: 1
91+
path: ../../src/Property/Selector.php
92+
93+
-
94+
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\.$#'
95+
identifier: argument.type
96+
count: 1
97+
path: ../../src/RuleSet/DeclarationBlock.php
98+
99+
-
100+
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\.$#'
101+
identifier: argument.type
102+
count: 1
103+
path: ../../src/RuleSet/DeclarationBlock.php
104+
105+
-
106+
message: '#^Property Sabberworm\\CSS\\RuleSet\\DeclarationBlock\:\:\$selectors \(list\<Sabberworm\\CSS\\Property\\Selector\>\) does not accept array\<int\<0, max\>, Sabberworm\\CSS\\Property\\Selector\>\.$#'
107+
identifier: assign.propertyType
108+
count: 1
109+
path: ../../src/RuleSet/DeclarationBlock.php
110+
111+
-
112+
message: '#^Property Sabberworm\\CSS\\RuleSet\\DeclarationBlock\:\:\$selectors \(list\<Sabberworm\\CSS\\Property\\Selector\>\) does not accept list\<Sabberworm\\CSS\\Property\\Selector\|string\>\.$#'
113+
identifier: assign.propertyType
114+
count: 1
115+
path: ../../src/RuleSet/DeclarationBlock.php
116+
117+
-
118+
message: '#^Parameter \#1 \$name of class Sabberworm\\CSS\\Value\\CSSFunction constructor expects non\-empty\-string, string given\.$#'
119+
identifier: argument.type
120+
count: 1
121+
path: ../../src/Value/CSSFunction.php
122+
15123
-
16124
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\.$#'
17125
identifier: argument.type
@@ -30,12 +138,42 @@ parameters:
30138
count: 3
31139
path: ../../src/Value/Color.php
32140

141+
-
142+
message: '#^Parameter \#1 \$name of method Sabberworm\\CSS\\Value\\CSSFunction\:\:__construct\(\) expects non\-empty\-string, string given\.$#'
143+
identifier: argument.type
144+
count: 1
145+
path: ../../src/Value/Color.php
146+
147+
-
148+
message: '#^Parameter \#1 \$name of method Sabberworm\\CSS\\Value\\CSSFunction\:\:setName\(\) expects non\-empty\-string, string given\.$#'
149+
identifier: argument.type
150+
count: 1
151+
path: ../../src/Value/Color.php
152+
153+
-
154+
message: '#^Method Sabberworm\\CSS\\Value\\Size\:\:render\(\) should return non\-empty\-string but returns string\.$#'
155+
identifier: return.type
156+
count: 1
157+
path: ../../src/Value/Size.php
158+
33159
-
34160
message: '#^Strict comparison using \!\=\= between non\-empty\-string and null will always evaluate to true\.$#'
35161
identifier: notIdentical.alwaysTrue
36162
count: 1
37163
path: ../../src/Value/Size.php
38164

165+
-
166+
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\.$#'
167+
identifier: return.type
168+
count: 1
169+
path: ../../src/Value/Value.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/Value.php
176+
39177
-
40178
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\.$#'
41179
identifier: argument.type
@@ -48,12 +186,36 @@ parameters:
48186
count: 1
49187
path: ../../src/Value/Value.php
50188

189+
-
190+
message: '#^Parameter \#1 \$propertyName of class Sabberworm\\CSS\\Property\\Declaration constructor expects non\-empty\-string, string given\.$#'
191+
identifier: argument.type
192+
count: 1
193+
path: ../../tests/Functional/RuleSet/RuleSetTest.php
194+
51195
-
52196
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertSame\(\) with ''red'' and Sabberworm\\CSS\\Value\\Value will always evaluate to false\.$#'
53197
identifier: staticMethod.impossibleType
54198
count: 1
55199
path: ../../tests/ParserTest.php
56200

201+
-
202+
message: '#^Cannot call method getListComponents\(\) on Sabberworm\\CSS\\Value\\RuleValueList\|string\.$#'
203+
identifier: method.nonObject
204+
count: 2
205+
path: ../../tests/ParserTest.php
206+
207+
-
208+
message: '#^Cannot call method getListSeparator\(\) on Sabberworm\\CSS\\Value\\RuleValueList\|string\.$#'
209+
identifier: method.nonObject
210+
count: 2
211+
path: ../../tests/ParserTest.php
212+
213+
-
214+
message: '#^Cannot call method render\(\) on Sabberworm\\CSS\\Value\\RuleValueList\|string\.$#'
215+
identifier: method.nonObject
216+
count: 1
217+
path: ../../tests/ParserTest.php
218+
57219
-
58220
message: '#^Parameter \#1 \$value of method Sabberworm\\CSS\\Property\\Declaration\:\:setValue\(\) expects Sabberworm\\CSS\\Value\\RuleValueList\|string\|null, Sabberworm\\CSS\\Value\\Size given\.$#'
59221
identifier: argument.type
@@ -83,3 +245,117 @@ parameters:
83245
identifier: argument.type
84246
count: 2
85247
path: ../../tests/Unit/CSSList/CSSListTest.php
248+
249+
-
250+
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\>\}\>\.$#'
251+
identifier: return.type
252+
count: 1
253+
path: ../../tests/Unit/Comment/CommentContainerTest.php
254+
255+
-
256+
message: '#^Parameter \#1 \$numberOfSpaces of method Sabberworm\\CSS\\OutputFormat\:\:indentWithSpaces\(\) expects int\<1, max\>, int given\.$#'
257+
identifier: argument.type
258+
count: 1
259+
path: ../../tests/Unit/OutputFormatTest.php
260+
261+
-
262+
message: '#^Parameter \#1 \$numberOfTabs of method Sabberworm\\CSS\\OutputFormat\:\:indentWithTabs\(\) expects int\<1, max\>, int given\.$#'
263+
identifier: argument.type
264+
count: 1
265+
path: ../../tests/Unit/OutputFormatTest.php
266+
267+
-
268+
message: '#^Parameter \#1 \$lineNumber of method Sabberworm\\CSS\\Tests\\Unit\\Position\\Fixtures\\ConcretePosition\:\:setPosition\(\) expects int\<1, max\>\|null, int given\.$#'
269+
identifier: argument.type
270+
count: 2
271+
path: ../../tests/Unit/Position/PositionTest.php
272+
273+
-
274+
message: '#^Parameter \#2 \$columnNumber of method Sabberworm\\CSS\\Tests\\Unit\\Position\\Fixtures\\ConcretePosition\:\:setPosition\(\) expects int\<0, max\>\|null, int given\.$#'
275+
identifier: argument.type
276+
count: 3
277+
path: ../../tests/Unit/Position/PositionTest.php
278+
279+
-
280+
message: '#^Cannot access offset 0 on array\<mixed\>\|bool\|float\|int\|string\|null\.$#'
281+
identifier: offsetAccess.nonOffsetAccessible
282+
count: 1
283+
path: ../../tests/Unit/Property/KeyframeSelectorTest.php
284+
285+
-
286+
message: '#^Parameter \#1 \$value of class Sabberworm\\CSS\\Property\\Selector\\Combinator constructor expects '' ''\|''\+''\|''\>''\|''~'', non\-empty\-string given\.$#'
287+
identifier: argument.type
288+
count: 1
289+
path: ../../tests/Unit/Property/Selector/CombinatorTest.php
290+
291+
-
292+
message: '#^Cannot access offset 0 on array\<mixed\>\|bool\|float\|int\|string\|null\.$#'
293+
identifier: offsetAccess.nonOffsetAccessible
294+
count: 1
295+
path: ../../tests/Unit/Property/SelectorTest.php
296+
297+
-
298+
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\.$#'
299+
identifier: argument.type
300+
count: 1
301+
path: ../../tests/Unit/Property/SelectorTest.php
302+
303+
-
304+
message: '#^Parameter \#1 \$selector of method Sabberworm\\CSS\\Property\\Selector\:\:setSelector\(\) expects non\-empty\-string, string given\.$#'
305+
identifier: argument.type
306+
count: 1
307+
path: ../../tests/Unit/Property/SelectorTest.php
308+
309+
-
310+
message: '#^Parameter \#1 \$propertyName of class Sabberworm\\CSS\\Property\\Declaration constructor expects non\-empty\-string, string given\.$#'
311+
identifier: argument.type
312+
count: 19
313+
path: ../../tests/Unit/RuleSet/DeclarationBlockTest.php
314+
315+
-
316+
message: '#^Parameter \#1 \$propertyName of class Sabberworm\\CSS\\Property\\Declaration constructor expects non\-empty\-string, string given\.$#'
317+
identifier: argument.type
318+
count: 19
319+
path: ../../tests/Unit/RuleSet/RuleSetTest.php
320+
321+
-
322+
message: '#^Cannot access offset 0 on array\<mixed\>\|bool\|float\|int\|string\|null\.$#'
323+
identifier: offsetAccess.nonOffsetAccessible
324+
count: 3
325+
path: ../../tests/Unit/Value/RuleValueListTest.php
326+
327+
-
328+
message: '#^Cannot access offset 1 on array\<mixed\>\|bool\|float\|int\|string\|null\.$#'
329+
identifier: offsetAccess.nonOffsetAccessible
330+
count: 1
331+
path: ../../tests/Unit/Value/RuleValueListTest.php
332+
333+
-
334+
message: '#^Cannot access offset 2 on array\<mixed\>\|bool\|float\|int\|string\|null\.$#'
335+
identifier: offsetAccess.nonOffsetAccessible
336+
count: 1
337+
path: ../../tests/Unit/Value/RuleValueListTest.php
338+
339+
-
340+
message: '#^Cannot access offset 0 on array\<mixed\>\|bool\|float\|int\|string\|null\.$#'
341+
identifier: offsetAccess.nonOffsetAccessible
342+
count: 3
343+
path: ../../tests/Unit/Value/ValueListTest.php
344+
345+
-
346+
message: '#^Cannot access offset 1 on array\<mixed\>\|bool\|float\|int\|string\|null\.$#'
347+
identifier: offsetAccess.nonOffsetAccessible
348+
count: 1
349+
path: ../../tests/Unit/Value/ValueListTest.php
350+
351+
-
352+
message: '#^Cannot access offset 2 on array\<mixed\>\|bool\|float\|int\|string\|null\.$#'
353+
identifier: offsetAccess.nonOffsetAccessible
354+
count: 1
355+
path: ../../tests/Unit/Value/ValueListTest.php
356+
357+
-
358+
message: '#^Cannot call method getArrayRepresentation\(\) on Sabberworm\\CSS\\Value\\Value\|string\.$#'
359+
identifier: method.nonObject
360+
count: 1
361+
path: ../../tests/Unit/Value/ValueTest.php

Build/phpstan/phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ includes:
44
parameters:
55
phpVersion: 70200
66

7-
level: 6
7+
level: 7
88

99
paths:
1010
- %currentWorkingDirectory%/bin/

0 commit comments

Comments
 (0)