Skip to content

Commit

Permalink
phpstan: Separate baseline by php version
Browse files Browse the repository at this point in the history
  • Loading branch information
sukhwinder33445 committed Mar 25, 2024
1 parent 9b0f1d8 commit 2ed7d65
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 6 deletions.
16 changes: 16 additions & 0 deletions phpstan-baseline-7x.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
parameters:
ignoreErrors:
-
message: "#^Method Icinga\\\\Module\\\\Cube\\\\Ido\\\\IdoHostStatusCube\\:\\:listAvailableDimensions\\(\\) should return array but returns array\\<string, string\\>\\|false\\.$#"
count: 1
path: library/Cube/Ido/IdoHostStatusCube.php

-
message: "#^Method Icinga\\\\Module\\\\Cube\\\\Ido\\\\IdoServiceStatusCube\\:\\:listAvailableDimensions\\(\\) should return array but returns array\\<string, string\\>\\|false\\.$#"
count: 1
path: library/Cube/Ido/IdoServiceStatusCube.php

-
message: "#^Parameter \\#1 \\$function of function call_user_func_array expects callable\\(\\)\\: mixed, array\\{Zend_Db_Select, string\\} given\\.$#"
count: 1
path: library/Cube/Ido/ZfSelectWrapper.php
6 changes: 6 additions & 0 deletions phpstan-baseline-8x.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\$callback of function call_user_func_array expects callable\\(\\)\\: mixed, array\\{Zend_Db_Select, string\\} given\\.$#"
count: 1
path: library/Cube/Ido/ZfSelectWrapper.php
13 changes: 13 additions & 0 deletions phpstan-baseline-by-php-version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

$includes = [];
if (PHP_VERSION_ID < 80000) {
$includes[] = __DIR__ . '/phpstan-baseline-7x.neon';
}
else {
$includes[] = __DIR__ . '/phpstan-baseline-8x.neon';
}

return [
'includes' => $includes
];
5 changes: 0 additions & 5 deletions phpstan-baseline.neon → phpstan-baseline-standard.neon
Original file line number Diff line number Diff line change
Expand Up @@ -985,11 +985,6 @@ parameters:
count: 1
path: library/Cube/Ido/ZfSelectWrapper.php

-
message: "#^Parameter \\#1 \\$callback of function call_user_func_array expects callable\\(\\)\\: mixed, array\\{Zend_Db_Select, string\\} given\\.$#"
count: 1
path: library/Cube/Ido/ZfSelectWrapper.php

-
message: "#^Parameter \\#1 \\$rule of method ipl\\\\Stdlib\\\\Filter\\\\Chain\\:\\:add\\(\\) expects ipl\\\\Stdlib\\\\Filter\\\\Rule, ipl\\\\Stdlib\\\\Filter\\\\Rule\\|null given\\.$#"
count: 1
Expand Down
3 changes: 2 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
includes:
- phpstan-baseline.neon
- phpstan-baseline-standard.neon
- phpstan-baseline-by-php-version.php

parameters:
level: max
Expand Down

0 comments on commit 2ed7d65

Please sign in to comment.