Skip to content

Commit 334c975

Browse files
committed
[TASK] Raise PHPStan to level 3
1 parent 5c440f3 commit 334c975

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

config/phpstan-baseline.neon

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ parameters:
1212
count: 1
1313
path: ../src/CSSList/AtRuleBlockList.php
1414

15+
-
16+
message: '#^Parameter &\$result by\-ref type of method Sabberworm\\CSS\\CSSList\\CSSBlockList\:\:allSelectors\(\) expects array\<int, Sabberworm\\CSS\\Property\\Selector\>, array\<int, Sabberworm\\CSS\\Property\\Selector\|string\> given\.$#'
17+
identifier: parameterByRef.type
18+
count: 2
19+
path: ../src/CSSList/CSSBlockList.php
20+
21+
-
22+
message: '#^Parameter &\$result by\-ref type of method Sabberworm\\CSS\\CSSList\\CSSBlockList\:\:allValues\(\) expects array\<int, Sabberworm\\CSS\\Value\\Value\>, array\<int, Sabberworm\\CSS\\CSSList\\CSSList\|Sabberworm\\CSS\\Value\\Value\> given\.$#'
23+
identifier: parameterByRef.type
24+
count: 1
25+
path: ../src/CSSList/CSSBlockList.php
26+
1527
-
1628
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:safely\(\)\.$#'
1729
identifier: method.notFound
@@ -54,6 +66,24 @@ parameters:
5466
count: 1
5567
path: ../src/CSSList/KeyFrame.php
5668

69+
-
70+
message: '#^Method Sabberworm\\CSS\\OutputFormat\:\:getRGBHashNotation\(\) should return bool but returns string\.$#'
71+
identifier: return.type
72+
count: 1
73+
path: ../src/OutputFormat.php
74+
75+
-
76+
message: '#^Property Sabberworm\\CSS\\OutputFormat\:\:\$bRGBHashNotation \(string\) does not accept bool\.$#'
77+
identifier: assign.propertyType
78+
count: 1
79+
path: ../src/OutputFormat.php
80+
81+
-
82+
message: '#^Property Sabberworm\\CSS\\OutputFormat\:\:\$bRGBHashNotation \(string\) does not accept default value of type true\.$#'
83+
identifier: property.defaultValue
84+
count: 1
85+
path: ../src/OutputFormat.php
86+
5787
-
5888
message: '#^Default value of the parameter \#2 \$bIncludeEnd \(false\) of method Sabberworm\\CSS\\Parsing\\ParserState\:\:consumeUntil\(\) is incompatible with type string\.$#'
5989
identifier: parameter.defaultValue
@@ -78,12 +108,24 @@ parameters:
78108
count: 1
79109
path: ../src/Property/CSSNamespace.php
80110

111+
-
112+
message: '#^Return type \(array\<int, string\>\) of method Sabberworm\\CSS\\Property\\CSSNamespace\:\:atRuleArgs\(\) should be compatible with return type \(string\|null\) of method Sabberworm\\CSS\\Property\\AtRule\:\:atRuleArgs\(\)$#'
113+
identifier: method.childReturnType
114+
count: 1
115+
path: ../src/Property/CSSNamespace.php
116+
81117
-
82118
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:comments\(\)\.$#'
83119
identifier: method.notFound
84120
count: 1
85121
path: ../src/Property/Charset.php
86122

123+
-
124+
message: '#^Method Sabberworm\\CSS\\Property\\Charset\:\:atRuleArgs\(\) should return string but returns Sabberworm\\CSS\\Value\\CSSString\.$#'
125+
identifier: return.type
126+
count: 1
127+
path: ../src/Property/Charset.php
128+
87129
-
88130
message: '#^PHPDoc tag @param references unknown parameter\: \$oCharset$#'
89131
identifier: parameter.notFound
@@ -96,6 +138,12 @@ parameters:
96138
count: 1
97139
path: ../src/Property/Import.php
98140

141+
-
142+
message: '#^Return type \(array\<int, Sabberworm\\CSS\\Value\\URL\|string\>\) of method Sabberworm\\CSS\\Property\\Import\:\:atRuleArgs\(\) should be compatible with return type \(string\|null\) of method Sabberworm\\CSS\\Property\\AtRule\:\:atRuleArgs\(\)$#'
143+
identifier: method.childReturnType
144+
count: 1
145+
path: ../src/Property/Import.php
146+
99147
-
100148
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:comments\(\)\.$#'
101149
identifier: method.notFound
@@ -150,6 +198,12 @@ parameters:
150198
count: 1
151199
path: ../src/RuleSet/DeclarationBlock.php
152200

201+
-
202+
message: '#^Argument of an invalid type Sabberworm\\CSS\\Rule\\Rule supplied for foreach, only iterables are supported\.$#'
203+
identifier: foreach.nonIterable
204+
count: 2
205+
path: ../src/RuleSet/RuleSet.php
206+
153207
-
154208
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:removeLastSemicolon\(\)\.$#'
155209
identifier: method.notFound
@@ -234,4 +288,9 @@ parameters:
234288
count: 1
235289
path: ../src/Value/ValueList.php
236290

291+
-
292+
message: '#^Method Sabberworm\\CSS\\Tests\\Unit\\Value\\ValueTest\:\:provideCssFunctionTemplates\(\) should return array\<string, array\{string, string\}\> but returns array\{calc\: array\{to be parsed\: ''calc\(%%s\);'', expected\: ''calc\(%%s\)''\}, max\: array\{to be parsed\: ''max\(300px, %%s\);'', expected\: ''max\(300px,%%s\)''\}, clamp\: array\{to be parsed\: ''clamp\(2\.19rem, %%s,…'', expected\: ''clamp\(2\.19rem,%%s,2…''\}\}\.$#'
293+
identifier: return.type
294+
count: 1
295+
path: ../tests/Unit/Value/ValueTest.php
237296

config/phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ parameters:
66
# Don't be overly greedy on machines with more CPU's to be a good neighbor especially on CI
77
maximumNumberOfProcesses: 5
88

9-
level: 2
9+
level: 3
1010

1111
paths:
1212
- %currentWorkingDirectory%/bin/

0 commit comments

Comments
 (0)