diff --git a/php-version-baseline.php b/php-version-baseline.php new file mode 100644 index 000000000..0268dabcd --- /dev/null +++ b/php-version-baseline.php @@ -0,0 +1,12 @@ += 80000) { + $includes[] = __DIR__ . '/phpstan-baseline-8x.neon'; +} else { + $includes[] = __DIR__ . '/phpstan-baseline-7x.neon'; +} + +return [ + 'includes' => $includes +]; diff --git a/phpstan-baseline-7x.neon b/phpstan-baseline-7x.neon new file mode 100644 index 000000000..79c2cba41 --- /dev/null +++ b/phpstan-baseline-7x.neon @@ -0,0 +1,26 @@ +parameters: + ignoreErrors: + - + message: "#^Parameter \\#2 \\$assoc of function json_decode expects bool\\|null, int given\\.$#" + count: 1 + path: application/forms/ChannelForm.php + + - + message: "#^Parameter \\#2 \\.\\.\\.\\$args of function array_merge expects array, mixed given\\.$#" + count: 1 + path: application/forms/ChannelForm.php + + - + message: "#^Parameter \\#2 \\$str of function explode expects string, mixed given\\.$#" + count: 2 + path: application/forms/EntryForm.php + + - + message: "#^Parameter \\#2 \\$str of function explode expects string, mixed given\\.$#" + count: 2 + path: application/forms/EscalationRecipientForm.php + + - + message: "#^Parameter \\#1 \\$time of function strtotime expects string, mixed given\\.$#" + count: 1 + path: library/Notifications/Widget/Calendar.php diff --git a/phpstan-baseline-8x.neon b/phpstan-baseline-8x.neon new file mode 100644 index 000000000..55ee9a383 --- /dev/null +++ b/phpstan-baseline-8x.neon @@ -0,0 +1,26 @@ +parameters: + ignoreErrors: + - + message: "#^Parameter \\#2 \\$associative of function json_decode expects bool\\|null, int given\\.$#" + count: 1 + path: application/forms/ChannelForm.php + + - + message: "#^Parameter \\#2 \\.\\.\\.\\$arrays of function array_merge expects array, mixed given\\.$#" + count: 1 + path: application/forms/ChannelForm.php + + - + message: "#^Parameter \\#2 \\$string of function explode expects string, mixed given\\.$#" + count: 2 + path: application/forms/EntryForm.php + + - + message: "#^Parameter \\#2 \\$string of function explode expects string, mixed given\\.$#" + count: 2 + path: application/forms/EscalationRecipientForm.php + + - + message: "#^Parameter \\#1 \\$datetime of function strtotime expects string, mixed given\\.$#" + count: 1 + path: library/Notifications/Widget/Calendar.php diff --git a/phpstan-baseline.neon b/phpstan-baseline-all.neon similarity index 99% rename from phpstan-baseline.neon rename to phpstan-baseline-all.neon index de140e67e..4dc0203c9 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline-all.neon @@ -405,16 +405,6 @@ parameters: count: 1 path: application/forms/ChannelForm.php - - - message: "#^Parameter \\#2 \\$associative of function json_decode expects bool\\|null, int given\\.$#" - count: 1 - path: application/forms/ChannelForm.php - - - - message: "#^Parameter \\#2 \\.\\.\\.\\$arrays of function array_merge expects array, mixed given\\.$#" - count: 1 - path: application/forms/ChannelForm.php - - message: "#^Method Icinga\\\\Module\\\\Notifications\\\\Forms\\\\DatabaseConfigForm\\:\\:assemble\\(\\) has no return type specified\\.$#" count: 1 @@ -565,11 +555,6 @@ parameters: count: 2 path: application/forms/EntryForm.php - - - message: "#^Parameter \\#2 \\$string of function explode expects string, mixed given\\.$#" - count: 2 - path: application/forms/EntryForm.php - - message: "#^Parameter \\#2 \\$value of static method ipl\\\\Stdlib\\\\Filter\\:\\:equal\\(\\) expects array\\|bool\\|float\\|int\\|string, mixed given\\.$#" count: 1 @@ -670,11 +655,6 @@ parameters: count: 1 path: application/forms/EscalationRecipientForm.php - - - message: "#^Parameter \\#2 \\$string of function explode expects string, mixed given\\.$#" - count: 2 - path: application/forms/EscalationRecipientForm.php - - message: "#^Method Icinga\\\\Module\\\\Notifications\\\\Forms\\\\EventRuleForm\\:\\:assemble\\(\\) has no return type specified\\.$#" count: 1 @@ -1280,11 +1260,6 @@ parameters: count: 1 path: library/Notifications/Widget/Calendar.php - - - message: "#^Parameter \\#1 \\$datetime of function strtotime expects string, mixed given\\.$#" - count: 1 - path: library/Notifications/Widget/Calendar.php - - message: "#^Parameter \\#1 \\$from of static method Icinga\\\\Module\\\\Notifications\\\\Widget\\\\Calendar\\\\Util\\:\\:diffHours\\(\\) expects DateTime, DateTime\\|null given\\.$#" count: 2 diff --git a/phpstan.neon b/phpstan.neon index 96126412d..324584af6 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,6 @@ includes: - - phpstan-baseline.neon + - phpstan-baseline-all.neon + - php-version-baseline.php parameters: level: max