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 a1e1b53
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
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
10 changes: 10 additions & 0 deletions phpstan-baseline-by-php-version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

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

return [
'includes' => $includes
];
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 a1e1b53

Please sign in to comment.