Skip to content

Commit 201c271

Browse files
Phpstan: Seprate phpstan baseline files by php version
1 parent 5297152 commit 201c271

5 files changed

Lines changed: 41 additions & 11 deletions

phpstan-baseline-7x.neon

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: "#^Parameter \\#1 \\$arr1 of function array_merge_recursive expects array, array\\|object\\|null given\\.$#"
5+
count: 1
6+
path: src/Form.php
7+
8+
-
9+
message: "#^Parameter \\#3 \\$length of function substr expects int, int\\<1, max\\>\\|null given\\.$#"
10+
count: 1
11+
path: src/FormElement/LocalDateTimeElement.php
12+
13+
-
14+
message: "#^Parameter \\#2 \\$args of function vsprintf expects array\\<bool\\|float\\|int\\|string\\|null\\>, array\\<ipl\\\\Html\\\\ValidHtml\\> given\\.$#"
15+
count: 1
16+
path: src/FormattedString.php

phpstan-baseline-8x.neon

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: "#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge_recursive expects array, array\\|object\\|null given\\.$#"
5+
count: 1
6+
path: src/Form.php
7+
8+
-
9+
message: "#^Parameter \\#2 \\$values of function vsprintf expects array\\<bool\\|float\\|int\\|string\\|null\\>, array\\<ipl\\\\Html\\\\ValidHtml\\> given\\.$#"
10+
count: 1
11+
path: src/FormattedString.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-8x.neon';
6+
} else {
7+
$includes[] = __DIR__ . '/phpstan-baseline-7x.neon';
8+
}
9+
10+
return [
11+
'includes' => $includes
12+
];
Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,6 @@ parameters:
245245
count: 1
246246
path: src/Form.php
247247

248-
-
249-
message: "#^Parameter \\#1 \\.\\.\\.\\$arrays of function array_merge_recursive expects array, array\\|object\\|null given\\.$#"
250-
count: 1
251-
path: src/Form.php
252-
253248
-
254249
message: "#^Parameter \\#3 \\$postfix of method ipl\\\\Html\\\\Form\\:\\:addPluginLoader\\(\\) expects string, string\\|null given\\.$#"
255250
count: 2
@@ -590,11 +585,6 @@ parameters:
590585
count: 1
591586
path: src/FormattedString.php
592587

593-
-
594-
message: "#^Parameter \\#2 \\$values of function vsprintf expects array\\<bool\\|float\\|int\\|string\\|null\\>, array\\<ipl\\\\Html\\\\ValidHtml\\> given\\.$#"
595-
count: 1
596-
path: src/FormattedString.php
597-
598588
-
599589
message: "#^Property ipl\\\\Html\\\\FormattedString\\:\\:\\$args \\(array\\<ipl\\\\Html\\\\ValidHtml\\>\\) does not accept array\\<bool\\|float\\|int\\|ipl\\\\Html\\\\ValidHtml\\|string\\>\\.$#"
600590
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)