Skip to content

Commit f068a94

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

File tree

2 files changed

+175
-1
lines changed

2 files changed

+175
-1
lines changed

config/phpstan-baseline.neon

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,35 @@
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+
315
-
416
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\.$#'
517
identifier: argument.type
618
count: 1
719
path: ../src/CSSList/CSSList.php
820

21+
-
22+
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\.$#'
23+
identifier: argument.type
24+
count: 1
25+
path: ../src/CSSList/CSSList.php
26+
27+
-
28+
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\.$#'
29+
identifier: argument.type
30+
count: 1
31+
path: ../src/CSSList/CSSList.php
32+
933
-
1034
message: '#^Parameters should have "Sabberworm\\CSS\\CSSList\\CSSListItem\|array" types as the only types passed to this method$#'
1135
identifier: typePerfect.narrowPublicClassMethodParamType
@@ -18,18 +42,72 @@ parameters:
1842
count: 1
1943
path: ../src/CSSList/Document.php
2044

45+
-
46+
message: '#^Method Sabberworm\\CSS\\Parsing\\ParserState\:\:parseIdentifier\(\) should return non\-empty\-string but returns string\.$#'
47+
identifier: return.type
48+
count: 1
49+
path: ../src/Parsing/ParserState.php
50+
51+
-
52+
message: '#^Method Sabberworm\\CSS\\Parsing\\ParserState\:\:strlen\(\) should return int\<0, max\> but returns int\<0, max\>\|false\.$#'
53+
identifier: return.type
54+
count: 1
55+
path: ../src/Parsing/ParserState.php
56+
2157
-
2258
message: '#^Negated boolean expression is always true\.$#'
2359
identifier: booleanNot.alwaysTrue
2460
count: 1
2561
path: ../src/Parsing/ParserState.php
2662

63+
-
64+
message: '#^Property Sabberworm\\CSS\\Parsing\\ParserState\:\:\$currentPosition \(int\<0, max\>\) does not accept int\.$#'
65+
identifier: assign.propertyType
66+
count: 2
67+
path: ../src/Parsing/ParserState.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/Rule/Rule.php
74+
75+
-
76+
message: '#^Parameter \#1 \$value of method Sabberworm\\CSS\\Rule\\Rule\:\:setValue\(\) expects Sabberworm\\CSS\\Value\\RuleValueList\|string\|null, Sabberworm\\CSS\\Value\\Value\|string given\.$#'
77+
identifier: argument.type
78+
count: 1
79+
path: ../src/Rule/Rule.php
80+
81+
-
82+
message: '#^Parameter \#1 \$comments of method Sabberworm\\CSS\\RuleSet\\DeclarationBlock\:\:setComments\(\) expects list\<Sabberworm\\CSS\\Comment\\Comment\>, array\<int, Sabberworm\\CSS\\Comment\\Comment\> given\.$#'
83+
identifier: argument.type
84+
count: 1
85+
path: ../src/RuleSet/DeclarationBlock.php
86+
2787
-
2888
message: '#^Parameters should have "string" types as the only types passed to this method$#'
2989
identifier: typePerfect.narrowPublicClassMethodParamType
3090
count: 1
3191
path: ../src/RuleSet/DeclarationBlock.php
3292

93+
-
94+
message: '#^Property Sabberworm\\CSS\\RuleSet\\DeclarationBlock\:\:\$selectors \(list\<Sabberworm\\CSS\\Property\\Selector\>\) does not accept array\<int\<0, max\>, Sabberworm\\CSS\\Property\\Selector\>\.$#'
95+
identifier: assign.propertyType
96+
count: 1
97+
path: ../src/RuleSet/DeclarationBlock.php
98+
99+
-
100+
message: '#^Property Sabberworm\\CSS\\RuleSet\\DeclarationBlock\:\:\$selectors \(list\<Sabberworm\\CSS\\Property\\Selector\>\) does not accept list\<Sabberworm\\CSS\\Property\\Selector\|string\>\.$#'
101+
identifier: assign.propertyType
102+
count: 1
103+
path: ../src/RuleSet/DeclarationBlock.php
104+
105+
-
106+
message: '#^Parameter \#1 \$name of class Sabberworm\\CSS\\Value\\CSSFunction constructor expects non\-empty\-string, string given\.$#'
107+
identifier: argument.type
108+
count: 1
109+
path: ../src/Value/CSSFunction.php
110+
33111
-
34112
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\.$#'
35113
identifier: argument.type
@@ -48,6 +126,24 @@ parameters:
48126
count: 3
49127
path: ../src/Value/Color.php
50128

129+
-
130+
message: '#^Parameter \#1 \$name of method Sabberworm\\CSS\\Value\\CSSFunction\:\:__construct\(\) expects non\-empty\-string, string given\.$#'
131+
identifier: argument.type
132+
count: 1
133+
path: ../src/Value/Color.php
134+
135+
-
136+
message: '#^Parameter \#1 \$name of method Sabberworm\\CSS\\Value\\CSSFunction\:\:setName\(\) expects non\-empty\-string, string given\.$#'
137+
identifier: argument.type
138+
count: 1
139+
path: ../src/Value/Color.php
140+
141+
-
142+
message: '#^Method Sabberworm\\CSS\\Value\\Size\:\:render\(\) should return non\-empty\-string but returns string\.$#'
143+
identifier: return.type
144+
count: 1
145+
path: ../src/Value/Size.php
146+
51147
-
52148
message: '#^Parameters should have "float" types as the only types passed to this method$#'
53149
identifier: typePerfect.narrowPublicClassMethodParamType
@@ -60,6 +156,18 @@ parameters:
60156
count: 1
61157
path: ../src/Value/Size.php
62158

159+
-
160+
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\.$#'
161+
identifier: return.type
162+
count: 1
163+
path: ../src/Value/Value.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/Value.php
170+
63171
-
64172
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\.$#'
65173
identifier: argument.type
@@ -72,12 +180,36 @@ parameters:
72180
count: 1
73181
path: ../src/Value/Value.php
74182

183+
-
184+
message: '#^Parameter \#1 \$rule of class Sabberworm\\CSS\\Rule\\Rule constructor expects non\-empty\-string, string given\.$#'
185+
identifier: argument.type
186+
count: 1
187+
path: ../tests/Functional/RuleSet/RuleSetTest.php
188+
75189
-
76190
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertSame\(\) with ''red'' and Sabberworm\\CSS\\Value\\Value will always evaluate to false\.$#'
77191
identifier: staticMethod.impossibleType
78192
count: 1
79193
path: ../tests/ParserTest.php
80194

195+
-
196+
message: '#^Cannot call method getListComponents\(\) on Sabberworm\\CSS\\Value\\RuleValueList\|string\.$#'
197+
identifier: method.nonObject
198+
count: 2
199+
path: ../tests/ParserTest.php
200+
201+
-
202+
message: '#^Cannot call method getListSeparator\(\) 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 render\(\) on Sabberworm\\CSS\\Value\\RuleValueList\|string\.$#'
209+
identifier: method.nonObject
210+
count: 1
211+
path: ../tests/ParserTest.php
212+
81213
-
82214
message: '#^Parameter \#1 \$value of method Sabberworm\\CSS\\Rule\\Rule\:\:setValue\(\) expects Sabberworm\\CSS\\Value\\RuleValueList\|string\|null, Sabberworm\\CSS\\Value\\Size given\.$#'
83215
identifier: argument.type
@@ -107,3 +239,45 @@ parameters:
107239
identifier: argument.type
108240
count: 2
109241
path: ../tests/Unit/CSSList/CSSListTest.php
242+
243+
-
244+
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\>\}\>\.$#'
245+
identifier: return.type
246+
count: 1
247+
path: ../tests/Unit/Comment/CommentContainerTest.php
248+
249+
-
250+
message: '#^Parameter \#1 \$numberOfSpaces of method Sabberworm\\CSS\\OutputFormat\:\:indentWithSpaces\(\) expects int\<1, max\>, int given\.$#'
251+
identifier: argument.type
252+
count: 1
253+
path: ../tests/Unit/OutputFormatTest.php
254+
255+
-
256+
message: '#^Parameter \#1 \$numberOfTabs of method Sabberworm\\CSS\\OutputFormat\:\:indentWithTabs\(\) 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 \$lineNumber of method Sabberworm\\CSS\\Tests\\Unit\\Position\\Fixtures\\ConcretePosition\:\:setPosition\(\) expects int\<1, max\>\|null, int given\.$#'
263+
identifier: argument.type
264+
count: 2
265+
path: ../tests/Unit/Position/PositionTest.php
266+
267+
-
268+
message: '#^Parameter \#2 \$columnNumber of method Sabberworm\\CSS\\Tests\\Unit\\Position\\Fixtures\\ConcretePosition\:\:setPosition\(\) expects int\<0, max\>\|null, int given\.$#'
269+
identifier: argument.type
270+
count: 3
271+
path: ../tests/Unit/Position/PositionTest.php
272+
273+
-
274+
message: '#^Parameter \#1 \$rule of class Sabberworm\\CSS\\Rule\\Rule constructor expects non\-empty\-string, string given\.$#'
275+
identifier: argument.type
276+
count: 19
277+
path: ../tests/Unit/RuleSet/DeclarationBlockTest.php
278+
279+
-
280+
message: '#^Parameter \#1 \$rule of class Sabberworm\\CSS\\Rule\\Rule constructor expects non\-empty\-string, string given\.$#'
281+
identifier: argument.type
282+
count: 19
283+
path: ../tests/Unit/RuleSet/RuleSetTest.php

config/phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ parameters:
88

99
phpVersion: 70200
1010

11-
level: 6
11+
level: 7
1212

1313
paths:
1414
- %currentWorkingDirectory%/bin/

0 commit comments

Comments
 (0)