Skip to content

Commit f806671

Browse files
Separate phpstan baselines by php version
1 parent 90e2be2 commit f806671

File tree

5 files changed

+71
-21
lines changed

5 files changed

+71
-21
lines changed

phpstan-baseline-7x.neon

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: "#^Parameter \\#1 \\$str of function urldecode expects string, mixed given\\.$#"
5+
count: 1
6+
path: application/controllers/HostsController.php
7+
8+
-
9+
message: "#^Parameter \\#1 \\$str of function urldecode expects string, mixed given\\.$#"
10+
count: 1
11+
path: application/controllers/ServicesController.php
12+
13+
-
14+
message: "#^Argument of an invalid type array\\<int, string\\>\\|false supplied for foreach, only iterables are supported\\.$#"
15+
count: 1
16+
path: library/Graphite/Util/MacroTemplate.php
17+
18+
-
19+
message: "#^Cannot access offset int on non\\-empty\\-array\\<int, string\\>\\|false\\.$#"
20+
count: 1
21+
path: library/Graphite/Util/MacroTemplate.php
22+
23+
-
24+
message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, array\\<int, string\\>\\|false given\\.$#"
25+
count: 1
26+
path: library/Graphite/Util/MacroTemplate.php
27+
28+
-
29+
message: "#^Property Icinga\\\\Module\\\\Graphite\\\\Util\\\\MacroTemplate\\:\\:\\$template \\(array\\<string\\>\\) does not accept array\\<int, string\\>\\|false\\.$#"
30+
count: 1
31+
path: library/Graphite/Util/MacroTemplate.php
32+
33+
-
34+
message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#"
35+
count: 1
36+
path: library/Graphite/Web/Controller/MonitoringAwareController.php

phpstan-baseline-8x.neon

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: "#^Parameter \\#1 \\$string of function urldecode expects string, mixed given\\.$#"
5+
count: 1
6+
path: application/controllers/HostsController.php
7+
8+
-
9+
message: "#^Parameter \\#1 \\$string of function urldecode expects string, mixed given\\.$#"
10+
count: 1
11+
path: application/controllers/ServicesController.php
12+
13+
-
14+
message: "#^Parameter \\#1 \\$separator of function explode expects non\\-empty\\-string, string given\\.$#"
15+
count: 1
16+
path: library/Graphite/Util/MacroTemplate.php
17+
18+
-
19+
message: "#^Parameter \\#1 \\$string of function strtolower expects string, mixed given\\.$#"
20+
count: 1
21+
path: library/Graphite/Web/Controller/MonitoringAwareController.php
Lines changed: 12 additions & 0 deletions
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-7x.neon';
6+
} else {
7+
$includes[] = __DIR__ . '/phpstan-baseline-8x.neon';
8+
}
9+
10+
return [
11+
'includes' => $includes
12+
];
Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,6 @@ parameters:
8080
count: 1
8181
path: application/controllers/HostsController.php
8282

83-
-
84-
message: "#^Parameter \\#1 \\$string of function urldecode expects string, mixed given\\.$#"
85-
count: 1
86-
path: application/controllers/HostsController.php
87-
8883
-
8984
message: "#^Parameter \\#2 \\$value of static method ipl\\\\Stdlib\\\\Filter\\:\\:equal\\(\\) expects array\\|bool\\|float\\|int\\|string, mixed given\\.$#"
9085
count: 1
@@ -185,11 +180,6 @@ parameters:
185180
count: 1
186181
path: application/controllers/ServicesController.php
187182

188-
-
189-
message: "#^Parameter \\#1 \\$string of function urldecode expects string, mixed given\\.$#"
190-
count: 1
191-
path: application/controllers/ServicesController.php
192-
193183
-
194184
message: "#^Parameter \\#2 \\$value of static method ipl\\\\Stdlib\\\\Filter\\:\\:equal\\(\\) expects array\\|bool\\|float\\|int\\|string, mixed given\\.$#"
195185
count: 1
@@ -515,11 +505,6 @@ parameters:
515505
count: 1
516506
path: library/Graphite/Util/InternalProcessTracker.php
517507

518-
-
519-
message: "#^Parameter \\#1 \\$separator of function explode expects non\\-empty\\-string, string given\\.$#"
520-
count: 1
521-
path: library/Graphite/Util/MacroTemplate.php
522-
523508
-
524509
message: "#^Cannot cast mixed to int\\.$#"
525510
count: 2
@@ -560,11 +545,6 @@ parameters:
560545
count: 1
561546
path: library/Graphite/Web/Controller/MonitoringAwareController.php
562547

563-
-
564-
message: "#^Parameter \\#1 \\$string of function strtolower expects string, mixed given\\.$#"
565-
count: 1
566-
path: library/Graphite/Web/Controller/MonitoringAwareController.php
567-
568548
-
569549
message: "#^Parameter \\#1 \\$value of method Icinga\\\\Module\\\\Graphite\\\\Web\\\\Form\\\\Validator\\\\CustomErrorMessagesValidator\\:\\:validate\\(\\) expects string, mixed given\\.$#"
570550
count: 1

phpstan.neon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
includes:
2-
- phpstan-baseline.neon
2+
- phpstan-baseline-standard.neon
3+
- phpstan-baseline-by-php-version.php
34

45
parameters:
56
level: max

0 commit comments

Comments
 (0)