diff --git a/library/Icingadb/Widget/Detail/MultiselectQuickActions.php b/library/Icingadb/Widget/Detail/MultiselectQuickActions.php index f398d80e5..b80ec9df2 100644 --- a/library/Icingadb/Widget/Detail/MultiselectQuickActions.php +++ b/library/Icingadb/Widget/Detail/MultiselectQuickActions.php @@ -67,6 +67,7 @@ protected function assemble() ) { $removeAckForm = (new RemoveAcknowledgementForm()) ->setAction($this->getLink('removeAcknowledgement')) + // TODO: This is a hack as for the button label the count of objects is used. setCount? setMultiple? ->setObjects(array_fill(0, $this->summary->$acks, null)); $this->add(Html::tag('li', $removeAckForm)); diff --git a/phpstan-baseline-7x.neon b/phpstan-baseline-7x.neon index e8d2562f2..6da352556 100644 --- a/phpstan-baseline-7x.neon +++ b/phpstan-baseline-7x.neon @@ -5,61 +5,6 @@ parameters: count: 1 path: application/controllers/EventController.php - - - message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#" - count: 2 - path: application/forms/Command/Object/AcknowledgeProblemForm.php - - - - message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#" - count: 2 - path: application/forms/Command/Object/AddCommentForm.php - - - - message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#" - count: 1 - path: application/forms/Command/Object/CheckNowForm.php - - - - message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#" - count: 2 - path: application/forms/Command/Object/DeleteCommentForm.php - - - - message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#" - count: 2 - path: application/forms/Command/Object/DeleteDowntimeForm.php - - - - message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#" - count: 2 - path: application/forms/Command/Object/ProcessCheckResultForm.php - - - - message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#" - count: 2 - path: application/forms/Command/Object/RemoveAcknowledgementForm.php - - - - message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#" - count: 2 - path: application/forms/Command/Object/ScheduleCheckForm.php - - - - message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#" - count: 1 - path: application/forms/Command/Object/ScheduleHostDowntimeForm.php - - - - message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#" - count: 2 - path: application/forms/Command/Object/ScheduleServiceDowntimeForm.php - - - - message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#" - count: 2 - path: application/forms/Command/Object/SendCustomNotificationForm.php - - message: "#^Parameter \\#1 \\$str of function md5 expects string, mixed given\\.$#" count: 1 @@ -164,3 +109,8 @@ parameters: message: "#^Parameter \\#2 \\$str of function explode expects string, mixed given\\.$#" count: 1 path: library/Icingadb/Web/Controller.php + + - + message: "#^Parameter \\#1 \\$objects of method Icinga\\\\Module\\\\Icingadb\\\\Forms\\\\Command\\\\CommandForm\\:\\:setObjects\\(\\) expects array\\\\|\\(Countable&Traversable\\\\), array\\\\|false given\\.$#" + count: 1 + path: library/Icingadb/Widget/Detail/MultiselectQuickActions.php diff --git a/phpstan-baseline-8x.neon b/phpstan-baseline-8x.neon index 2cea59701..b5b85f7f9 100644 --- a/phpstan-baseline-8x.neon +++ b/phpstan-baseline-8x.neon @@ -5,61 +5,6 @@ parameters: count: 1 path: application/controllers/EventController.php - - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#" - count: 2 - path: application/forms/Command/Object/AcknowledgeProblemForm.php - - - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#" - count: 2 - path: application/forms/Command/Object/AddCommentForm.php - - - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#" - count: 1 - path: application/forms/Command/Object/CheckNowForm.php - - - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#" - count: 2 - path: application/forms/Command/Object/DeleteCommentForm.php - - - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#" - count: 2 - path: application/forms/Command/Object/DeleteDowntimeForm.php - - - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#" - count: 2 - path: application/forms/Command/Object/ProcessCheckResultForm.php - - - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#" - count: 2 - path: application/forms/Command/Object/RemoveAcknowledgementForm.php - - - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#" - count: 2 - path: application/forms/Command/Object/ScheduleCheckForm.php - - - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#" - count: 1 - path: application/forms/Command/Object/ScheduleHostDowntimeForm.php - - - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#" - count: 2 - path: application/forms/Command/Object/ScheduleServiceDowntimeForm.php - - - - message: "#^Parameter \\#1 \\$value of function count expects array\\|Countable, mixed given\\.$#" - count: 2 - path: application/forms/Command/Object/SendCustomNotificationForm.php - - message: "#^Parameter \\#1 \\$string of function md5 expects string, mixed given\\.$#" count: 1 @@ -159,3 +104,8 @@ parameters: message: "#^Parameter \\#2 \\$string of function explode expects string, mixed given\\.$#" count: 1 path: library/Icingadb/Web/Controller.php + + - + message: "#^Parameter \\#1 \\$objects of method Icinga\\\\Module\\\\Icingadb\\\\Forms\\\\Command\\\\CommandForm\\:\\:setObjects\\(\\) expects array\\\\|\\(Countable&Traversable\\\\), array\\ given\\.$#" + count: 1 + path: library/Icingadb/Widget/Detail/MultiselectQuickActions.php diff --git a/phpstan-baseline-standard.neon b/phpstan-baseline-standard.neon index 70fd385d2..5d23e8296 100644 --- a/phpstan-baseline-standard.neon +++ b/phpstan-baseline-standard.neon @@ -120,16 +120,6 @@ parameters: count: 1 path: application/controllers/CommentController.php - - - message: "#^Property Icinga\\\\Module\\\\Icingadb\\\\Controllers\\\\CommentController\\:\\:\\$commandTargets \\(ipl\\\\Orm\\\\Query\\) does not accept array\\.$#" - count: 1 - path: application/controllers/CommentController.php - - - - message: "#^Property Icinga\\\\Module\\\\Icingadb\\\\Controllers\\\\CommentController\\:\\:\\$commandTargets \\(ipl\\\\Orm\\\\Query\\) in isset\\(\\) is not nullable\\.$#" - count: 1 - path: application/controllers/CommentController.php - - message: "#^Property Icinga\\\\Module\\\\Icingadb\\\\Controllers\\\\CommentController\\:\\:\\$comment \\(Icinga\\\\Module\\\\Icingadb\\\\Model\\\\Comment\\) does not accept ipl\\\\Orm\\\\Model\\.$#" count: 1 @@ -260,16 +250,6 @@ parameters: count: 1 path: application/controllers/DowntimeController.php - - - message: "#^Property Icinga\\\\Module\\\\Icingadb\\\\Controllers\\\\DowntimeController\\:\\:\\$commandTargets \\(ipl\\\\Orm\\\\Query\\) does not accept array\\.$#" - count: 1 - path: application/controllers/DowntimeController.php - - - - message: "#^Property Icinga\\\\Module\\\\Icingadb\\\\Controllers\\\\DowntimeController\\:\\:\\$commandTargets \\(ipl\\\\Orm\\\\Query\\) in isset\\(\\) is not nullable\\.$#" - count: 1 - path: application/controllers/DowntimeController.php - - message: "#^Property Icinga\\\\Module\\\\Icingadb\\\\Controllers\\\\DowntimeController\\:\\:\\$downtime \\(Icinga\\\\Module\\\\Icingadb\\\\Model\\\\Downtime\\) does not accept ipl\\\\Orm\\\\Model\\.$#" count: 1 @@ -525,16 +505,6 @@ parameters: count: 1 path: application/controllers/HostController.php - - - message: "#^Property Icinga\\\\Module\\\\Icingadb\\\\Controllers\\\\HostController\\:\\:\\$commandTargets \\(ipl\\\\Orm\\\\Query\\) does not accept array\\.$#" - count: 1 - path: application/controllers/HostController.php - - - - message: "#^Property Icinga\\\\Module\\\\Icingadb\\\\Controllers\\\\HostController\\:\\:\\$commandTargets \\(ipl\\\\Orm\\\\Query\\) in isset\\(\\) is not nullable\\.$#" - count: 1 - path: application/controllers/HostController.php - - message: "#^Method Icinga\\\\Module\\\\Icingadb\\\\Controllers\\\\HostgroupController\\:\\:indexAction\\(\\) has no return type specified\\.$#" count: 1 @@ -695,11 +665,6 @@ parameters: count: 1 path: application/controllers/HostsController.php - - - message: "#^Property Icinga\\\\Module\\\\Icingadb\\\\Controllers\\\\HostsController\\:\\:\\$commandTargets \\(ipl\\\\Orm\\\\Query\\) in isset\\(\\) is not nullable\\.$#" - count: 1 - path: application/controllers/HostsController.php - - message: "#^Method Icinga\\\\Module\\\\Icingadb\\\\Controllers\\\\MigrateController\\:\\:backendSupportAction\\(\\) has no return type specified\\.$#" count: 1 @@ -920,16 +885,6 @@ parameters: count: 1 path: application/controllers/ServiceController.php - - - message: "#^Property Icinga\\\\Module\\\\Icingadb\\\\Controllers\\\\ServiceController\\:\\:\\$commandTargets \\(ipl\\\\Orm\\\\Query\\) does not accept array\\.$#" - count: 1 - path: application/controllers/ServiceController.php - - - - message: "#^Property Icinga\\\\Module\\\\Icingadb\\\\Controllers\\\\ServiceController\\:\\:\\$commandTargets \\(ipl\\\\Orm\\\\Query\\) in isset\\(\\) is not nullable\\.$#" - count: 1 - path: application/controllers/ServiceController.php - - message: "#^Method Icinga\\\\Module\\\\Icingadb\\\\Controllers\\\\ServicegroupController\\:\\:indexAction\\(\\) has no return type specified\\.$#" count: 1 @@ -1130,11 +1085,6 @@ parameters: count: 1 path: application/controllers/ServicesController.php - - - message: "#^Property Icinga\\\\Module\\\\Icingadb\\\\Controllers\\\\ServicesController\\:\\:\\$commandTargets \\(ipl\\\\Orm\\\\Query\\) in isset\\(\\) is not nullable\\.$#" - count: 1 - path: application/controllers/ServicesController.php - - message: "#^Method Icinga\\\\Module\\\\Icingadb\\\\Controllers\\\\TacticalController\\:\\:completeAction\\(\\) has no return type specified\\.$#" count: 1 @@ -1260,11 +1210,6 @@ parameters: count: 1 path: application/forms/Command/CommandForm.php - - - message: "#^Method Icinga\\\\Module\\\\Icingadb\\\\Forms\\\\Command\\\\CommandForm\\:\\:filterGrantedOn\\(\\) has parameter \\$objects with no value type specified in iterable type Traversable\\.$#" - count: 1 - path: application/forms/Command/CommandForm.php - - message: "#^Method Icinga\\\\Module\\\\Icingadb\\\\Forms\\\\Command\\\\CommandForm\\:\\:onSuccess\\(\\) has no return type specified\\.$#" count: 1 @@ -1285,11 +1230,6 @@ parameters: count: 2 path: application/forms/Command/CommandForm.php - - - message: "#^Parameter \\#1 \\$objects of method Icinga\\\\Module\\\\Icingadb\\\\Forms\\\\Command\\\\CommandForm\\:\\:getCommands\\(\\) expects Traversable\\, mixed given\\.$#" - count: 1 - path: application/forms/Command/CommandForm.php - - message: "#^Parameter \\#1 \\$queryString of method Icinga\\\\Module\\\\Icingadb\\\\Forms\\\\Command\\\\CommandForm\\:\\:parseRestriction\\(\\) expects string, array\\ given\\.$#" count: 3 @@ -1350,11 +1290,6 @@ parameters: count: 1 path: application/forms/Command/Object/AcknowledgeProblemForm.php - - - message: "#^Parameter \\#1 \\$iterable of function ipl\\\\Stdlib\\\\iterable_value_first expects iterable, mixed given\\.$#" - count: 1 - path: application/forms/Command/Object/AcknowledgeProblemForm.php - - message: "#^Call to an undefined method ipl\\\\Html\\\\Contract\\\\FormElement\\:\\:isChecked\\(\\)\\.$#" count: 1 @@ -1375,46 +1310,16 @@ parameters: count: 1 path: application/forms/Command/Object/AddCommentForm.php - - - message: "#^Parameter \\#1 \\$iterable of function ipl\\\\Stdlib\\\\iterable_value_first expects iterable, mixed given\\.$#" - count: 1 - path: application/forms/Command/Object/AddCommentForm.php - - message: "#^Cannot call method getUsername\\(\\) on Icinga\\\\User\\|null\\.$#" count: 1 path: application/forms/Command/Object/DeleteCommentForm.php - - - message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#" - count: 1 - path: application/forms/Command/Object/DeleteDowntimeForm.php - - - - message: "#^Cannot access property \\$scheduled_by on mixed\\.$#" - count: 1 - path: application/forms/Command/Object/DeleteDowntimeForm.php - - message: "#^Cannot call method getUsername\\(\\) on Icinga\\\\User\\|null\\.$#" count: 1 path: application/forms/Command/Object/DeleteDowntimeForm.php - - - message: "#^Cannot access property \\$passive_checks_enabled on mixed\\.$#" - count: 1 - path: application/forms/Command/Object/ProcessCheckResultForm.php - - - - message: "#^Parameter \\#1 \\$iterable of function ipl\\\\Stdlib\\\\iterable_value_first expects iterable, mixed given\\.$#" - count: 2 - path: application/forms/Command/Object/ProcessCheckResultForm.php - - - - message: "#^Parameter \\#1 \\$objects of method Icinga\\\\Module\\\\Icingadb\\\\Command\\\\Object\\\\ObjectsCommand\\:\\:setObjects\\(\\) expects Traversable\\, Generator\\ given\\.$#" - count: 1 - path: application/forms/Command/Object/ProcessCheckResultForm.php - - message: "#^Parameter \\#1 \\$output of method Icinga\\\\Module\\\\Icingadb\\\\Command\\\\Object\\\\ProcessCheckResultCommand\\:\\:setOutput\\(\\) expects string, mixed given\\.$#" count: 1 @@ -1435,11 +1340,6 @@ parameters: count: 1 path: application/forms/Command/Object/RemoveAcknowledgementForm.php - - - message: "#^Parameter \\#1 \\$iterable of function ipl\\\\Stdlib\\\\iterable_value_first expects iterable, mixed given\\.$#" - count: 1 - path: application/forms/Command/Object/RemoveAcknowledgementForm.php - - message: "#^Call to an undefined method ipl\\\\Html\\\\Contract\\\\FormElement\\:\\:isChecked\\(\\)\\.$#" count: 1 @@ -1450,11 +1350,6 @@ parameters: count: 1 path: application/forms/Command/Object/ScheduleCheckForm.php - - - message: "#^Parameter \\#1 \\$iterable of function ipl\\\\Stdlib\\\\iterable_value_first expects iterable, mixed given\\.$#" - count: 1 - path: application/forms/Command/Object/ScheduleCheckForm.php - - message: "#^Call to an undefined method ipl\\\\Html\\\\Contract\\\\FormElement\\:\\:isChecked\\(\\)\\.$#" count: 2 @@ -1535,11 +1430,6 @@ parameters: count: 1 path: application/forms/Command/Object/SendCustomNotificationForm.php - - - message: "#^Parameter \\#1 \\$iterable of function ipl\\\\Stdlib\\\\iterable_value_first expects iterable, mixed given\\.$#" - count: 1 - path: application/forms/Command/Object/SendCustomNotificationForm.php - - message: "#^Cannot call method getAttributes\\(\\) on ipl\\\\Html\\\\Contract\\\\Wrappable\\|null\\.$#" count: 1