Skip to content

Commit 571febb

Browse files
authored
[TASK] Raise PHPStan to level 3 (#887)
1 parent b3e83b8 commit 571febb

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

config/phpstan-baseline.neon

Lines changed: 36 additions & 1 deletion
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
@@ -78,12 +90,24 @@ parameters:
7890
count: 1
7991
path: ../src/Property/CSSNamespace.php
8092

93+
-
94+
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\(\)$#'
95+
identifier: method.childReturnType
96+
count: 1
97+
path: ../src/Property/CSSNamespace.php
98+
8199
-
82100
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:comments\(\)\.$#'
83101
identifier: method.notFound
84102
count: 1
85103
path: ../src/Property/Charset.php
86104

105+
-
106+
message: '#^Method Sabberworm\\CSS\\Property\\Charset\:\:atRuleArgs\(\) should return string but returns Sabberworm\\CSS\\Value\\CSSString\.$#'
107+
identifier: return.type
108+
count: 1
109+
path: ../src/Property/Charset.php
110+
87111
-
88112
message: '#^PHPDoc tag @param references unknown parameter\: \$oCharset$#'
89113
identifier: parameter.notFound
@@ -96,6 +120,12 @@ parameters:
96120
count: 1
97121
path: ../src/Property/Import.php
98122

123+
-
124+
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\(\)$#'
125+
identifier: method.childReturnType
126+
count: 1
127+
path: ../src/Property/Import.php
128+
99129
-
100130
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:comments\(\)\.$#'
101131
identifier: method.notFound
@@ -150,6 +180,12 @@ parameters:
150180
count: 1
151181
path: ../src/RuleSet/DeclarationBlock.php
152182

183+
-
184+
message: '#^Argument of an invalid type Sabberworm\\CSS\\Rule\\Rule supplied for foreach, only iterables are supported\.$#'
185+
identifier: foreach.nonIterable
186+
count: 2
187+
path: ../src/RuleSet/RuleSet.php
188+
153189
-
154190
message: '#^Call to an undefined method Sabberworm\\CSS\\OutputFormat\:\:removeLastSemicolon\(\)\.$#'
155191
identifier: method.notFound
@@ -228,4 +264,3 @@ parameters:
228264
count: 1
229265
path: ../src/Value/ValueList.php
230266

231-

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)