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 26, 2024
1 parent ace4ef0 commit f0965ee
Show file tree
Hide file tree
Showing 5 changed files with 211 additions and 116 deletions.
81 changes: 81 additions & 0 deletions phpstan-baseline-7x.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\$fp of function fpassthru expects resource, resource\\|false given\\.$#"
count: 1
path: application/controllers/ProcessController.php

-
message: "#^Parameter \\#1 \\$fp of function fputcsv expects resource, resource\\|false given\\.$#"
count: 2
path: application/controllers/ProcessController.php

-
message: "#^Parameter \\#1 \\$fp of function rewind expects resource, resource\\|false given\\.$#"
count: 1
path: application/controllers/ProcessController.php

-
message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#"
count: 1
path: application/controllers/ProcessController.php

-
message: "#^Parameter \\#2 \\$args of function vsprintf expects array\\<bool\\|float\\|int\\|string\\|null\\>, array\\<int, mixed\\> given\\.$#"
count: 2
path: library/Businessprocess/BpConfig.php

-
message: "#^Parameter \\#2 \\$search of function array_key_exists expects array, array\\<Icinga\\\\Module\\\\Businessprocess\\\\Node\\>\\|null given\\.$#"
count: 1
path: library/Businessprocess/BpNode.php

-
message: "#^Parameter \\#1 \\$str of function ucfirst expects string, mixed given\\.$#"
count: 1
path: library/Businessprocess/Modification/NodeAction.php

-
message: "#^Parameter \\#2 \\$search of function array_key_exists expects array, mixed given\\.$#"
count: 1
path: library/Businessprocess/Monitoring/Backend/Ido/Query/HostStatusQuery.php

-
message: "#^Parameter \\#2 \\$search of function array_key_exists expects array, mixed given\\.$#"
count: 1
path: library/Businessprocess/Monitoring/Backend/Ido/Query/ServiceStatusQuery.php

-
message: "#^Parameter \\#2 \\.\\.\\.\\$args of function array_merge expects array, mixed given\\.$#"
count: 2
path: library/Businessprocess/State/IcingaDbState.php

-
message: "#^Parameter \\#1 \\$fp of function fclose expects resource, resource\\|false given\\.$#"
count: 1
path: library/Businessprocess/Storage/LegacyConfigParser.php

-
message: "#^Parameter \\#1 \\$fp of function fgets expects resource, resource\\|false given\\.$#"
count: 1
path: library/Businessprocess/Storage/LegacyConfigParser.php

-
message: "#^Parameter \\#1 \\$stack of function array_shift expects array, array\\<int, string\\>\\|false given\\.$#"
count: 1
path: library/Businessprocess/Storage/LegacyConfigParser.php

-
message: "#^Parameter \\#2 \\$args of function vsprintf expects array\\<bool\\|float\\|int\\|string\\|null\\>, array\\<int, mixed\\> given\\.$#"
count: 1
path: library/Businessprocess/Web/Controller.php

-
message: "#^Parameter \\#1 \\$stack of function array_pop expects array, array\\<int, string\\>\\|false given\\.$#"
count: 1
path: library/Businessprocess/Web/Form/FormLoader.php

-
message: "#^Parameter \\#1 \\$stack of function array_pop expects array, array\\<int, string\\>\\|false given\\.$#"
count: 1
path: library/Businessprocess/Web/Form/QuickForm.php
106 changes: 106 additions & 0 deletions phpstan-baseline-8x.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\$stream of function fpassthru expects resource, resource\\|false given\\.$#"
count: 1
path: application/controllers/ProcessController.php

-
message: "#^Parameter \\#1 \\$stream of function fputcsv expects resource, resource\\|false given\\.$#"
count: 2
path: application/controllers/ProcessController.php

-
message: "#^Parameter \\#1 \\$stream of function rewind expects resource, resource\\|false given\\.$#"
count: 1
path: application/controllers/ProcessController.php

-
message: "#^Parameter \\#1 \\$string of function strtolower expects string, mixed given\\.$#"
count: 1
path: application/controllers/ProcessController.php

-
message: "#^PHPDoc tag @var has invalid value \\(\\$res array\\<int, string\\>\\)\\: Unexpected token \"\\$res\", expected type at offset 9$#"
count: 1
path: application/forms/AddNodeForm.php

-
message: "#^Parameter \\#2 \\$values of function vsprintf expects array\\<bool\\|float\\|int\\|string\\|null\\>, array\\<int, mixed\\> given\\.$#"
count: 2
path: library/Businessprocess/BpConfig.php

-
message: "#^Parameter \\#2 \\$array of function array_key_exists expects array, array\\<Icinga\\\\Module\\\\Businessprocess\\\\Node\\>\\|null given\\.$#"
count: 1
path: library/Businessprocess/BpNode.php

-
message: "#^Parameter \\#1 \\$string of function ucfirst expects string, mixed given\\.$#"
count: 1
path: library/Businessprocess/Modification/NodeAction.php

-
message: "#^PHPDoc tag @var has invalid value \\(\\$res array\\<int, string\\>\\)\\: Unexpected token \"\\$res\", expected type at offset 9$#"
count: 1
path: library/Businessprocess/Modification/NodeApplyManualOrderAction.php

-
message: "#^PHPDoc tag @var has invalid value \\(\\$res array\\<int, string\\>\\)\\: Unexpected token \"\\$res\", expected type at offset 9$#"
count: 1
path: library/Businessprocess/Modification/NodeCopyAction.php

-
message: "#^PHPDoc tag @var has invalid value \\(\\$res array\\<int, string\\>\\)\\: Unexpected token \"\\$res\", expected type at offset 9$#"
count: 1
path: library/Businessprocess/Modification/NodeMoveAction.php

-
message: "#^Parameter \\#2 \\$array of function array_key_exists expects array, mixed given\\.$#"
count: 1
path: library/Businessprocess/Monitoring/Backend/Ido/Query/HostStatusQuery.php

-
message: "#^Parameter \\#2 \\$array of function array_key_exists expects array, mixed given\\.$#"
count: 1
path: library/Businessprocess/Monitoring/Backend/Ido/Query/ServiceStatusQuery.php

-
message: "#^PHPDoc tag @var has invalid value \\(\\$res array\\<int, string\\>\\)\\: Unexpected token \"\\$res\", expected type at offset 9$#"
count: 1
path: library/Businessprocess/Renderer/Renderer.php

-
message: "#^Parameter \\#2 \\.\\.\\.\\$arrays of function array_merge expects array, mixed given\\.$#"
count: 2
path: library/Businessprocess/State/IcingaDbState.php

-
message: "#^Parameter \\#1 \\$array of function array_shift expects array, array\\<int, string\\>\\|false given\\.$#"
count: 1
path: library/Businessprocess/Storage/LegacyConfigParser.php

-
message: "#^Parameter \\#1 \\$stream of function fclose expects resource, resource\\|false given\\.$#"
count: 1
path: library/Businessprocess/Storage/LegacyConfigParser.php

-
message: "#^Parameter \\#1 \\$stream of function fgets expects resource, resource\\|false given\\.$#"
count: 1
path: library/Businessprocess/Storage/LegacyConfigParser.php

-
message: "#^Parameter \\#2 \\$values of function vsprintf expects array\\<bool\\|float\\|int\\|string\\|null\\>, array\\<int, mixed\\> given\\.$#"
count: 1
path: library/Businessprocess/Web/Controller.php

-
message: "#^Parameter \\#1 \\$array of function array_pop expects array, array\\<int, string\\>\\|false given\\.$#"
count: 1
path: library/Businessprocess/Web/Form/FormLoader.php

-
message: "#^Parameter \\#1 \\$array of function array_pop expects array, array\\<int, string\\>\\|false given\\.$#"
count: 1
path: library/Businessprocess/Web/Form/QuickForm.php
12 changes: 12 additions & 0 deletions phpstan-baseline-by-php-version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

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

return [
'includes' => $includes
];
Loading

0 comments on commit f0965ee

Please sign in to comment.