Skip to content

Commit 1deee1c

Browse files
authored
Update PHPStan to 2.x (#187)
1 parent 17f7be9 commit 1deee1c

File tree

2 files changed

+91
-18
lines changed

2 files changed

+91
-18
lines changed

composer.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
},
1818
"require-dev": {
1919
"phpstan/extension-installer": "^1.4",
20-
"phpstan/phpstan": "^1.12",
21-
"phpstan/phpstan-deprecation-rules": "^1.2",
20+
"phpstan/phpstan": "^2",
21+
"phpstan/phpstan-deprecation-rules": "^2",
2222
"phpunit/phpunit": "^9.6",
2323
"symfony/var-dumper": "^5.3",
24-
"tomasvotruba/cognitive-complexity": "0.2.3",
25-
"tomasvotruba/type-coverage": "1.0.0",
26-
"tomasvotruba/unused-public": "1.1.0"
24+
"tomasvotruba/cognitive-complexity": "^1",
25+
"tomasvotruba/type-coverage": "^2.0",
26+
"tomasvotruba/unused-public": "^2.0"
2727
},
2828
"conflict": {
2929
"tomasvotruba/type-coverage": "<1.0"

phpstan-baseline.neon

Lines changed: 86 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,139 @@
11
parameters:
22
ignoreErrors:
33
-
4-
message: "#^Out of 28 possible constant types, only 0 \\- 0\\.0 %% actually have it\\. Add more constant types to get over 99 %%$#"
4+
message: '#^Out of 28 possible constant types, only 0 \- 0\.0 %% actually have it\. Add more constant types to get over 99 %%$#'
55
count: 2
66
path: lib/AnalyzeApplication.php
77

88
-
9-
message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|false given\\.$#"
9+
message: '#^Parameter \#1 \$json of function json_decode expects string, string\|false given\.$#'
10+
identifier: argument.type
1011
count: 1
1112
path: lib/AnalyzerResultReader.php
1213

1314
-
14-
message: "#^Call to function is_array\\(\\) with array\\{ignoreErrors\\?\\: list\\<array\\{message\\: string, count\\: int, path\\: string\\}\\>\\} will always evaluate to true\\.$#"
15+
message: '#^Parameter \#2 \$datetime of static method DateTimeImmutable\:\:createFromFormat\(\) expects string, mixed given\.$#'
16+
identifier: argument.type
17+
count: 1
18+
path: lib/AnalyzerResultReader.php
19+
20+
-
21+
message: '#^Property staabm\\PHPStanBaselineAnalysis\\AnalyzerResult\:\:\$anonymousVariables \(int\) does not accept mixed\.$#'
22+
identifier: assign.propertyType
23+
count: 1
24+
path: lib/AnalyzerResultReader.php
25+
26+
-
27+
message: '#^Property staabm\\PHPStanBaselineAnalysis\\AnalyzerResult\:\:\$classesComplexity \(int\) does not accept mixed\.$#'
28+
identifier: assign.propertyType
29+
count: 1
30+
path: lib/AnalyzerResultReader.php
31+
32+
-
33+
message: '#^Property staabm\\PHPStanBaselineAnalysis\\AnalyzerResult\:\:\$deprecations \(int\) does not accept mixed\.$#'
34+
identifier: assign.propertyType
35+
count: 1
36+
path: lib/AnalyzerResultReader.php
37+
38+
-
39+
message: '#^Property staabm\\PHPStanBaselineAnalysis\\AnalyzerResult\:\:\$invalidPhpdocs \(int\) does not accept mixed\.$#'
40+
identifier: assign.propertyType
41+
count: 1
42+
path: lib/AnalyzerResultReader.php
43+
44+
-
45+
message: '#^Property staabm\\PHPStanBaselineAnalysis\\AnalyzerResult\:\:\$overallErrors \(int\) does not accept mixed\.$#'
46+
identifier: assign.propertyType
47+
count: 1
48+
path: lib/AnalyzerResultReader.php
49+
50+
-
51+
message: '#^Property staabm\\PHPStanBaselineAnalysis\\AnalyzerResult\:\:\$paramTypeCoverage \(int\<0, 100\>\) does not accept mixed\.$#'
52+
identifier: assign.propertyType
53+
count: 1
54+
path: lib/AnalyzerResultReader.php
55+
56+
-
57+
message: '#^Property staabm\\PHPStanBaselineAnalysis\\AnalyzerResult\:\:\$propertyTypeCoverage \(int\<0, 100\>\) does not accept mixed\.$#'
58+
identifier: assign.propertyType
59+
count: 1
60+
path: lib/AnalyzerResultReader.php
61+
62+
-
63+
message: '#^Property staabm\\PHPStanBaselineAnalysis\\AnalyzerResult\:\:\$returnTypeCoverage \(int\<0, 100\>\) does not accept mixed\.$#'
64+
identifier: assign.propertyType
65+
count: 1
66+
path: lib/AnalyzerResultReader.php
67+
68+
-
69+
message: '#^Property staabm\\PHPStanBaselineAnalysis\\AnalyzerResult\:\:\$unknownTypes \(int\) does not accept mixed\.$#'
70+
identifier: assign.propertyType
71+
count: 1
72+
path: lib/AnalyzerResultReader.php
73+
74+
-
75+
message: '#^Property staabm\\PHPStanBaselineAnalysis\\AnalyzerResult\:\:\$unusedSymbols \(int\) does not accept mixed\.$#'
76+
identifier: assign.propertyType
77+
count: 1
78+
path: lib/AnalyzerResultReader.php
79+
80+
-
81+
message: '#^Call to function is_array\(\) with array\{ignoreErrors\?\: list\<array\{message\: string, count\: int, path\: string\}\>\} will always evaluate to true\.$#'
82+
identifier: function.alreadyNarrowedType
1583
count: 1
1684
path: lib/Baseline.php
1785

1886
-
19-
message: "#^Call to function is_array\\(\\) with list\\<array\\{message\\: string, count\\: int, path\\: string\\}\\> will always evaluate to true\\.$#"
87+
message: '#^Call to function is_array\(\) with list\<array\{message\: string, count\: int, path\: string\}\> will always evaluate to true\.$#'
88+
identifier: function.alreadyNarrowedType
2089
count: 1
2190
path: lib/Baseline.php
2291

2392
-
24-
message: "#^Parameter \\#1 \\$input of static method Nette\\\\Neon\\\\Neon\\:\\:decode\\(\\) expects string, string\\|false given\\.$#"
93+
message: '#^Parameter \#1 \$input of static method Nette\\Neon\\Neon\:\:decode\(\) expects string, string\|false given\.$#'
94+
identifier: argument.type
2595
count: 1
2696
path: lib/Baseline.php
2797

2898
-
29-
message: "#^Property staabm\\\\PHPStanBaselineAnalysis\\\\Baseline\\:\\:\\$content \\(array\\{parameters\\?\\: array\\{ignoreErrors\\?\\: list\\<array\\{message\\: string, count\\: int, path\\: string\\}\\>\\}\\}\\) does not accept array\\.$#"
99+
message: '#^Property staabm\\PHPStanBaselineAnalysis\\Baseline\:\:\$content \(array\{parameters\?\: array\{ignoreErrors\?\: list\<array\{message\: string, count\: int, path\: string\}\>\}\}\) does not accept array\<mixed, mixed\>\.$#'
100+
identifier: assign.propertyType
30101
count: 1
31102
path: lib/Baseline.php
32103

33104
-
34-
message: "#^Method staabm\\\\PHPStanBaselineAnalysis\\\\BaselineAnalyzer\\:\\:normalizeMessage\\(\\) should return string but returns string\\|null\\.$#"
105+
message: '#^Method staabm\\PHPStanBaselineAnalysis\\BaselineAnalyzer\:\:normalizeMessage\(\) should return string but returns string\|null\.$#'
106+
identifier: return.type
35107
count: 1
36108
path: lib/BaselineAnalyzer.php
37109

38110
-
39-
message: "#^Out of 28 possible constant types, only 0 \\- 0\\.0 %% actually have it\\. Add more constant types to get over 99 %%$#"
111+
message: '#^Out of 28 possible constant types, only 0 \- 0\.0 %% actually have it\. Add more constant types to get over 99 %%$#'
40112
count: 4
41113
path: lib/BaselineAnalyzer.php
42114

43115
-
44-
message: "#^Out of 28 possible constant types, only 0 \\- 0\\.0 %% actually have it\\. Add more constant types to get over 99 %%$#"
116+
message: '#^Out of 28 possible constant types, only 0 \- 0\.0 %% actually have it\. Add more constant types to get over 99 %%$#'
45117
count: 2
46118
path: lib/FilterApplication.php
47119

48120
-
49-
message: "#^Out of 28 possible constant types, only 0 \\- 0\\.0 %% actually have it\\. Add more constant types to get over 99 %%$#"
121+
message: '#^Out of 28 possible constant types, only 0 \- 0\.0 %% actually have it\. Add more constant types to get over 99 %%$#'
50122
count: 1
51123
path: lib/GraphTemplate.php
52124

53125
-
54-
message: "#^Generator expects value type string, string\\|false given\\.$#"
126+
message: '#^Generator expects value type string, string\|false given\.$#'
127+
identifier: generator.valueType
55128
count: 1
56129
path: lib/ResultPrinter.php
57130

58131
-
59-
message: "#^Out of 28 possible constant types, only 0 \\- 0\\.0 %% actually have it\\. Add more constant types to get over 99 %%$#"
132+
message: '#^Out of 28 possible constant types, only 0 \- 0\.0 %% actually have it\. Add more constant types to get over 99 %%$#'
60133
count: 14
61134
path: lib/ResultPrinter.php
62135

63136
-
64-
message: "#^Out of 28 possible constant types, only 0 \\- 0\\.0 %% actually have it\\. Add more constant types to get over 99 %%$#"
137+
message: '#^Out of 28 possible constant types, only 0 \- 0\.0 %% actually have it\. Add more constant types to get over 99 %%$#'
65138
count: 5
66139
path: lib/TrendApplication.php

0 commit comments

Comments
 (0)