Skip to content

Commit 6274975

Browse files
committed
chore: upgrade phpstan to v2
1 parent 704dd0e commit 6274975

File tree

2 files changed

+67
-10
lines changed

2 files changed

+67
-10
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
"require-dev": {
4646
"phpunit/phpunit": "^8 || ^9 || ^10 || ^11 || ^12",
47-
"phpstan/phpstan": "^1.4.6",
47+
"phpstan/phpstan": "^2.1",
4848
"wdes/coding-standard": "^3.2"
4949
},
5050
"autoload": {

phpstan-baseline.neon

Lines changed: 66 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,104 @@
11
parameters:
22
ignoreErrors:
33
-
4-
message: "#^Method CodeLts\\\\CliTools\\\\ErrorFormatter\\\\CheckstyleErrorFormatter\\:\\:groupByFile\\(\\) return type has no value type specified in iterable type array\\.$#"
4+
message: '#^Cannot call method getLine\(\) on mixed\.$#'
5+
identifier: method.nonObject
56
count: 1
67
path: src/ErrorFormatter/CheckstyleErrorFormatter.php
78

89
-
9-
message: "#^Method CodeLts\\\\CliTools\\\\Tests\\\\ErrorFormatter\\\\CheckstyleErrorFormatterTest\\:\\:dataFormatterOutputProvider\\(\\) return type has no value type specified in iterable type array\\.$#"
10+
message: '#^Cannot call method getMessage\(\) on mixed\.$#'
11+
identifier: method.nonObject
12+
count: 1
13+
path: src/ErrorFormatter/CheckstyleErrorFormatter.php
14+
15+
-
16+
message: '#^Cannot cast mixed to string\.$#'
17+
identifier: cast.string
18+
count: 2
19+
path: src/ErrorFormatter/CheckstyleErrorFormatter.php
20+
21+
-
22+
message: '#^Method CodeLts\\CliTools\\ErrorFormatter\\CheckstyleErrorFormatter\:\:groupByFile\(\) return type has no value type specified in iterable type array\.$#'
23+
identifier: missingType.iterableValue
24+
count: 1
25+
path: src/ErrorFormatter/CheckstyleErrorFormatter.php
26+
27+
-
28+
message: '#^Binary operation "\." between non\-falsy\-string and mixed results in an error\.$#'
29+
identifier: binaryOp.invalid
30+
count: 1
31+
path: src/ErrorFormatter/TeamcityErrorFormatter.php
32+
33+
-
34+
message: '#^Parameter \#1 \$string of function wordwrap expects string, mixed given\.$#'
35+
identifier: argument.type
36+
count: 1
37+
path: src/ErrorsConsoleStyle.php
38+
39+
-
40+
message: '#^Parameter \#2 \$array of function array_map expects array, mixed given\.$#'
41+
identifier: argument.type
42+
count: 2
43+
path: src/ErrorsConsoleStyle.php
44+
45+
-
46+
message: '#^Method CodeLts\\CliTools\\Tests\\ErrorFormatter\\CheckstyleErrorFormatterTest\:\:dataFormatterOutputProvider\(\) return type has no value type specified in iterable type array\.$#'
47+
identifier: missingType.iterableValue
1048
count: 1
1149
path: tests/Unit/ErrorFormatter/CheckstyleErrorFormatterTest.php
1250

1351
-
14-
message: "#^Method CodeLts\\\\CliTools\\\\Tests\\\\ErrorFormatter\\\\GithubErrorFormatterTest\\:\\:dataFormatterOutputProvider\\(\\) return type has no value type specified in iterable type array\\.$#"
52+
message: '#^Method CodeLts\\CliTools\\Tests\\ErrorFormatter\\GithubErrorFormatterTest\:\:dataFormatterOutputProvider\(\) return type has no value type specified in iterable type array\.$#'
53+
identifier: missingType.iterableValue
1554
count: 1
1655
path: tests/Unit/ErrorFormatter/GithubErrorFormatterTest.php
1756

1857
-
19-
message: "#^Method CodeLts\\\\CliTools\\\\Tests\\\\ErrorFormatter\\\\GitlabFormatterTest\\:\\:dataFormatterOutputProvider\\(\\) return type has no value type specified in iterable type array\\.$#"
58+
message: '#^Method CodeLts\\CliTools\\Tests\\ErrorFormatter\\GitlabFormatterTest\:\:dataFormatterOutputProvider\(\) return type has no value type specified in iterable type array\.$#'
59+
identifier: missingType.iterableValue
2060
count: 1
2161
path: tests/Unit/ErrorFormatter/GitlabFormatterTest.php
2262

2363
-
24-
message: "#^Method CodeLts\\\\CliTools\\\\Tests\\\\ErrorFormatter\\\\JsonErrorFormatterTest\\:\\:dataFormatterOutputProvider\\(\\) return type has no value type specified in iterable type array\\.$#"
64+
message: '#^Method CodeLts\\CliTools\\Tests\\ErrorFormatter\\JsonErrorFormatterTest\:\:dataFormatterOutputProvider\(\) return type has no value type specified in iterable type array\.$#'
65+
identifier: missingType.iterableValue
2566
count: 1
2667
path: tests/Unit/ErrorFormatter/JsonErrorFormatterTest.php
2768

2869
-
29-
message: "#^Method CodeLts\\\\CliTools\\\\Tests\\\\ErrorFormatter\\\\RawErrorFormatterTest\\:\\:dataFormatterOutputProvider\\(\\) return type has no value type specified in iterable type array\\.$#"
70+
message: '#^Method CodeLts\\CliTools\\Tests\\ErrorFormatter\\RawErrorFormatterTest\:\:dataFormatterOutputProvider\(\) return type has no value type specified in iterable type array\.$#'
71+
identifier: missingType.iterableValue
3072
count: 1
3173
path: tests/Unit/ErrorFormatter/RawErrorFormatterTest.php
3274

3375
-
34-
message: "#^Method CodeLts\\\\CliTools\\\\Tests\\\\ErrorFormatter\\\\TableErrorFormatterTest\\:\\:dataFormatterOutputProvider\\(\\) return type has no value type specified in iterable type array\\.$#"
76+
message: '#^Method CodeLts\\CliTools\\Tests\\ErrorFormatter\\TableErrorFormatterTest\:\:dataFormatterOutputProvider\(\) return type has no value type specified in iterable type array\.$#'
77+
identifier: missingType.iterableValue
3578
count: 1
3679
path: tests/Unit/ErrorFormatter/TableErrorFormatterTest.php
3780

3881
-
39-
message: "#^Method CodeLts\\\\CliTools\\\\Tests\\\\ErrorFormatter\\\\TeamcityErrorFormatterTest\\:\\:dataFormatterOutputProvider\\(\\) return type has no value type specified in iterable type array\\.$#"
82+
message: '#^Method CodeLts\\CliTools\\Tests\\ErrorFormatter\\TeamcityErrorFormatterTest\:\:dataFormatterOutputProvider\(\) return type has no value type specified in iterable type array\.$#'
83+
identifier: missingType.iterableValue
4084
count: 1
4185
path: tests/Unit/ErrorFormatter/TeamcityErrorFormatterTest.php
4286

4387
-
44-
message: "#^Method CodeLts\\\\CliTools\\\\Tests\\\\Unit\\\\OutputFormatTest\\:\\:dataProviderFormatsNames\\(\\) return type has no value type specified in iterable type array\\.$#"
88+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertTrue\(\) with true will always evaluate to true\.$#'
89+
identifier: method.alreadyNarrowedType
90+
count: 2
91+
path: tests/Unit/OutputFormatTest.php
92+
93+
-
94+
message: '#^Method CodeLts\\CliTools\\Tests\\Unit\\OutputFormatTest\:\:dataProviderFormatsNames\(\) return type has no value type specified in iterable type array\.$#'
95+
identifier: missingType.iterableValue
4596
count: 1
4697
path: tests/Unit/OutputFormatTest.php
4798

99+
-
100+
message: '#^Call to method PHPUnit\\Framework\\Assert\:\:assertIsBool\(\) with bool will always evaluate to true\.$#'
101+
identifier: method.alreadyNarrowedType
102+
count: 1
103+
path: tests/Unit/UtilsTest.php
104+

0 commit comments

Comments
 (0)