Skip to content

Commit f082717

Browse files
Phpstan: Create php version based baseline
1 parent 4c25771 commit f082717

5 files changed

+312
-147
lines changed

phpstan-baseline-7x.neon

+151
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: "#^Parameter \\#1 \\$data of function hex2bin expects string, mixed given\\.$#"
5+
count: 1
6+
path: application/controllers/EventController.php
7+
8+
-
9+
message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#"
10+
count: 2
11+
path: application/forms/Command/Object/AcknowledgeProblemForm.php
12+
13+
-
14+
message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#"
15+
count: 2
16+
path: application/forms/Command/Object/AddCommentForm.php
17+
18+
-
19+
message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#"
20+
count: 1
21+
path: application/forms/Command/Object/CheckNowForm.php
22+
23+
-
24+
message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#"
25+
count: 2
26+
path: application/forms/Command/Object/DeleteCommentForm.php
27+
28+
-
29+
message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#"
30+
count: 2
31+
path: application/forms/Command/Object/DeleteDowntimeForm.php
32+
33+
-
34+
message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#"
35+
count: 2
36+
path: application/forms/Command/Object/ProcessCheckResultForm.php
37+
38+
-
39+
message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#"
40+
count: 2
41+
path: application/forms/Command/Object/RemoveAcknowledgementForm.php
42+
43+
-
44+
message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#"
45+
count: 2
46+
path: application/forms/Command/Object/ScheduleCheckForm.php
47+
48+
-
49+
message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#"
50+
count: 1
51+
path: application/forms/Command/Object/ScheduleHostDowntimeForm.php
52+
53+
-
54+
message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#"
55+
count: 2
56+
path: application/forms/Command/Object/ScheduleServiceDowntimeForm.php
57+
58+
-
59+
message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#"
60+
count: 2
61+
path: application/forms/Command/Object/SendCustomNotificationForm.php
62+
63+
-
64+
message: "#^Parameter \\#1 \\$str of function md5 expects string, mixed given\\.$#"
65+
count: 1
66+
path: application/forms/RedisConfigForm.php
67+
68+
-
69+
message: "#^Parameter \\#1 \\$stack of function array_pop expects array, mixed given\\.$#"
70+
count: 1
71+
path: library/Icingadb/Command/Transport/ApiCommandTransport.php
72+
73+
-
74+
message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#"
75+
count: 1
76+
path: library/Icingadb/Command/Transport/CommandTransport.php
77+
78+
-
79+
message: "#^Parameter \\#2 \\.\\.\\.\\$args of function array_merge expects array, mixed given\\.$#"
80+
count: 1
81+
path: library/Icingadb/Common/IcingaRedis.php
82+
83+
-
84+
message: "#^Parameter \\#1 \\$arr1 of function array_diff_key expects array, mixed given\\.$#"
85+
count: 1
86+
path: library/Icingadb/Common/ObjectInspectionDetail.php
87+
88+
-
89+
message: "#^Parameter \\#1 \\$data of function bin2hex expects string, mixed given\\.$#"
90+
count: 1
91+
path: library/Icingadb/Common/ObjectInspectionDetail.php
92+
93+
-
94+
message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#"
95+
count: 2
96+
path: library/Icingadb/Compat/UrlMigrator.php
97+
98+
-
99+
message: "#^Parameter \\#1 \\$input of function array_keys expects array, mixed given\\.$#"
100+
count: 1
101+
path: library/Icingadb/Data/CsvResultSet.php
102+
103+
-
104+
message: "#^Parameter \\#1 \\$input of function array_values expects array, mixed given\\.$#"
105+
count: 1
106+
path: library/Icingadb/Data/CsvResultSet.php
107+
108+
-
109+
message: "#^Parameter \\#2 \\$str of function explode expects string, mixed given\\.$#"
110+
count: 1
111+
path: library/Icingadb/Data/PivotTable.php
112+
113+
-
114+
message: "#^Parameter \\#2 \\$str of function explode expects string, mixed given\\.$#"
115+
count: 1
116+
path: library/Icingadb/Model/Behavior/ActionAndNoteUrl.php
117+
118+
-
119+
message: "#^Parameter \\#2 \\.\\.\\.\\$args of function array_merge expects array, array\\<int, string\\>\\|false given\\.$#"
120+
count: 1
121+
path: library/Icingadb/Model/CustomvarFlat.php
122+
123+
-
124+
message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, Icinga\\\\Module\\\\Reporting\\\\ReportData\\|null given\\.$#"
125+
count: 1
126+
path: library/Icingadb/ProvidedHook/Reporting/SlaReport.php
127+
128+
-
129+
message: "#^Parameter \\#1 \\$number of function number_format expects float, float\\|int\\|string given\\.$#"
130+
count: 1
131+
path: library/Icingadb/Util/PerfData.php
132+
133+
-
134+
message: "#^Parameter \\#1 \\$str of function trim expects string, string\\|null given\\.$#"
135+
count: 1
136+
path: library/Icingadb/Util/PluginOutput.php
137+
138+
-
139+
message: "#^Parameter \\#3 \\$encoding of function htmlspecialchars expects string, null given\\.$#"
140+
count: 1
141+
path: library/Icingadb/Util/PluginOutput.php
142+
143+
-
144+
message: "#^Parameter \\#1 \\$str of function trim expects string, mixed given\\.$#"
145+
count: 1
146+
path: library/Icingadb/Web/Controller.php
147+
148+
-
149+
message: "#^Parameter \\#2 \\$str of function explode expects string, mixed given\\.$#"
150+
count: 1
151+
path: library/Icingadb/Web/Controller.php

phpstan-baseline-8x.neon

+146
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: "#^Parameter \\#1 \\$string of function hex2bin expects string, mixed given\\.$#"
5+
count: 1
6+
path: application/controllers/EventController.php
7+
8+
-
9+
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#"
10+
count: 2
11+
path: application/forms/Command/Object/AcknowledgeProblemForm.php
12+
13+
-
14+
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#"
15+
count: 2
16+
path: application/forms/Command/Object/AddCommentForm.php
17+
18+
-
19+
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#"
20+
count: 1
21+
path: application/forms/Command/Object/CheckNowForm.php
22+
23+
-
24+
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#"
25+
count: 2
26+
path: application/forms/Command/Object/DeleteCommentForm.php
27+
28+
-
29+
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#"
30+
count: 2
31+
path: application/forms/Command/Object/DeleteDowntimeForm.php
32+
33+
-
34+
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#"
35+
count: 2
36+
path: application/forms/Command/Object/ProcessCheckResultForm.php
37+
38+
-
39+
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#"
40+
count: 2
41+
path: application/forms/Command/Object/RemoveAcknowledgementForm.php
42+
43+
-
44+
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#"
45+
count: 2
46+
path: application/forms/Command/Object/ScheduleCheckForm.php
47+
48+
-
49+
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#"
50+
count: 1
51+
path: application/forms/Command/Object/ScheduleHostDowntimeForm.php
52+
53+
-
54+
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#"
55+
count: 2
56+
path: application/forms/Command/Object/ScheduleServiceDowntimeForm.php
57+
58+
-
59+
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#"
60+
count: 2
61+
path: application/forms/Command/Object/SendCustomNotificationForm.php
62+
63+
-
64+
message: "#^Parameter \\#1 \\$string of function md5 expects string, mixed given\\.$#"
65+
count: 1
66+
path: application/forms/RedisConfigForm.php
67+
68+
-
69+
message: "#^Parameter \\#1 \\$array of function array_pop expects array, mixed given\\.$#"
70+
count: 1
71+
path: library/Icingadb/Command/Transport/ApiCommandTransport.php
72+
73+
-
74+
message: "#^Parameter \\#1 \\$string of function strtolower expects string, mixed given\\.$#"
75+
count: 1
76+
path: library/Icingadb/Command/Transport/CommandTransport.php
77+
78+
-
79+
message: "#^Parameter \\#2 \\.\\.\\.\\$arrays of function array_merge expects array, mixed given\\.$#"
80+
count: 1
81+
path: library/Icingadb/Common/IcingaRedis.php
82+
83+
-
84+
message: "#^Parameter \\#1 \\$array of function array_diff_key expects array, mixed given\\.$#"
85+
count: 1
86+
path: library/Icingadb/Common/ObjectInspectionDetail.php
87+
88+
-
89+
message: "#^Parameter \\#1 \\$string of function bin2hex expects string, mixed given\\.$#"
90+
count: 1
91+
path: library/Icingadb/Common/ObjectInspectionDetail.php
92+
93+
-
94+
message: "#^Parameter \\#1 \\$string of function strtolower expects string, mixed given\\.$#"
95+
count: 2
96+
path: library/Icingadb/Compat/UrlMigrator.php
97+
98+
-
99+
message: "#^Parameter \\#1 \\$array of function array_keys expects array, mixed given\\.$#"
100+
count: 1
101+
path: library/Icingadb/Data/CsvResultSet.php
102+
103+
-
104+
message: "#^Parameter \\#1 \\$array of function array_values expects array, mixed given\\.$#"
105+
count: 1
106+
path: library/Icingadb/Data/CsvResultSet.php
107+
108+
-
109+
message: "#^Parameter \\#2 \\$string of function explode expects string, mixed given\\.$#"
110+
count: 1
111+
path: library/Icingadb/Data/PivotTable.php
112+
113+
-
114+
message: "#^Parameter \\#2 \\$string of function explode expects string, mixed given\\.$#"
115+
count: 1
116+
path: library/Icingadb/Model/Behavior/ActionAndNoteUrl.php
117+
118+
-
119+
message: "#^Parameter \\#2 \\.\\.\\.\\$arrays of function array_merge expects array, array\\<int, string\\>\\|false given\\.$#"
120+
count: 1
121+
path: library/Icingadb/Model/CustomvarFlat.php
122+
123+
-
124+
message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, Icinga\\\\Module\\\\Reporting\\\\ReportData\\|null given\\.$#"
125+
count: 1
126+
path: library/Icingadb/ProvidedHook/Reporting/SlaReport.php
127+
128+
-
129+
message: "#^Parameter \\#1 \\$num of function number_format expects float, float\\|int\\|string given\\.$#"
130+
count: 1
131+
path: library/Icingadb/Util/PerfData.php
132+
133+
-
134+
message: "#^Parameter \\#1 \\$string of function trim expects string, string\\|null given\\.$#"
135+
count: 1
136+
path: library/Icingadb/Util/PluginOutput.php
137+
138+
-
139+
message: "#^Parameter \\#1 \\$string of function trim expects string, mixed given\\.$#"
140+
count: 1
141+
path: library/Icingadb/Web/Controller.php
142+
143+
-
144+
message: "#^Parameter \\#2 \\$string of function explode expects string, mixed given\\.$#"
145+
count: 1
146+
path: library/Icingadb/Web/Controller.php

phpstan-baseline-by-php-version.php

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
3+
$includes = [];
4+
if (PHP_VERSION_ID >= 80000) {
5+
$includes[] = __DIR__ . '/phpstan-baseline-8x.neon';
6+
} else {
7+
$includes[] = __DIR__ . '/phpstan-baseline-7x.neon';
8+
}
9+
10+
return [
11+
'includes' => $includes
12+
];

0 commit comments

Comments
 (0)