diff --git a/application/clicommands/MigrateCommand.php b/application/clicommands/MigrateCommand.php index 6d034ee39..17892bb45 100644 --- a/application/clicommands/MigrateCommand.php +++ b/application/clicommands/MigrateCommand.php @@ -496,9 +496,8 @@ public function dashboardAction(): void ); $changed = false; - /** @var ConfigObject $dashboardConfig */ + /** @var ConfigObject $dashboardConfig */ foreach ($dashboardsConfig->getConfigObject() as $name => $dashboardConfig) { - /** @var ?string $dashboardUrlString */ $dashboardUrlString = $dashboardConfig->get('url'); if ($dashboardUrlString !== null) { $dashBoardUrl = Url::fromPath($dashboardUrlString, [], new Request()); @@ -595,9 +594,8 @@ public function filterAction(): void private function transformNavigationItems(Config $config, string $owner, int &$rc): bool { $updated = false; - /** @var ConfigObject $newConfigObject */ + /** @var ConfigObject $newConfigObject */ foreach ($config->getConfigObject() as $section => $newConfigObject) { - /** @var string $configOwner */ $configOwner = $newConfigObject->get('owner') ?? ''; if ($configOwner && $configOwner !== $owner) { continue; @@ -686,9 +684,8 @@ private function migrateNavigationItems(Config $config, string $owner, string $p $newConfig = $config->getConfigFile() === $path ? $config : $this->readFromIni($path, $rc); $updated = false; - /** @var ConfigObject $configObject */ + /** @var ConfigObject $configObject */ foreach ($config->getConfigObject() as $configObject) { - /** @var string $configOwner */ $configOwner = $configObject->get('owner') ?? ''; if ($configOwner && $configOwner !== $owner) { continue; diff --git a/library/Icingadb/Command/Transport/CommandTransport.php b/library/Icingadb/Command/Transport/CommandTransport.php index ea125bc81..952cb1486 100644 --- a/library/Icingadb/Command/Transport/CommandTransport.php +++ b/library/Icingadb/Command/Transport/CommandTransport.php @@ -50,7 +50,7 @@ public static function getConfig(): Config /** * Create a transport from config * - * @param ConfigObject $config + * @param ConfigObject $config * * @return ApiCommandTransport * @@ -59,7 +59,7 @@ public static function getConfig(): Config public static function createTransport(ConfigObject $config): ApiCommandTransport { $config = clone $config; - switch (strtolower($config->transport)) { + switch (strtolower($config->transport ?? '')) { case ApiCommandTransport::TRANSPORT: $transport = new ApiCommandTransport(); break; diff --git a/library/Icingadb/Compat/CompatObject.php b/library/Icingadb/Compat/CompatObject.php index 6a30751d3..1d9657db8 100644 --- a/library/Icingadb/Compat/CompatObject.php +++ b/library/Icingadb/Compat/CompatObject.php @@ -361,13 +361,14 @@ protected function getDataView() */ private function getBoolType($value) { - switch ($value) { - case false: - return 0; - case true: - return 1; - case 'sticky': - return 2; + if ($value === 'sticky') { + return 2; } + + if (is_string($value)) { + return null; + } + + return (int) $value; } } diff --git a/library/Icingadb/Widget/ItemTable/BaseHostGroupItem.php b/library/Icingadb/Widget/ItemTable/BaseHostGroupItem.php index c56a1f8f6..b3099c802 100644 --- a/library/Icingadb/Widget/ItemTable/BaseHostGroupItem.php +++ b/library/Icingadb/Widget/ItemTable/BaseHostGroupItem.php @@ -5,7 +5,7 @@ namespace Icinga\Module\Icingadb\Widget\ItemTable; use Icinga\Module\Icingadb\Common\Links; -use Icinga\Module\Icingadb\Model\Hostgroup; +use Icinga\Module\Icingadb\Model\Hostgroupsummary; use ipl\Html\Attributes; use ipl\Html\BaseHtmlElement; use ipl\Html\HtmlElement; @@ -18,7 +18,7 @@ /** * Hostgroup item of a hostgroup list. Represents one database row. * - * @property Hostgroup $item + * @property Hostgroupsummary $item * @property HostgroupTable $table */ abstract class BaseHostGroupItem extends BaseTableRowItem diff --git a/library/Icingadb/Widget/ItemTable/BaseServiceGroupItem.php b/library/Icingadb/Widget/ItemTable/BaseServiceGroupItem.php index 7bee532ef..24f0beaae 100644 --- a/library/Icingadb/Widget/ItemTable/BaseServiceGroupItem.php +++ b/library/Icingadb/Widget/ItemTable/BaseServiceGroupItem.php @@ -5,7 +5,7 @@ namespace Icinga\Module\Icingadb\Widget\ItemTable; use Icinga\Module\Icingadb\Common\Links; -use Icinga\Module\Icingadb\Model\Servicegroup; +use Icinga\Module\Icingadb\Model\ServicegroupSummary; use ipl\Html\Attributes; use ipl\Html\BaseHtmlElement; use ipl\Html\HtmlElement; @@ -18,7 +18,7 @@ /** * Servicegroup item of a servicegroup list. Represents one database row. * - * @property Servicegroup $item + * @property ServicegroupSummary $item * @property ServicegroupTable $table */ abstract class BaseServiceGroupItem extends BaseTableRowItem diff --git a/library/Icingadb/Widget/ItemTable/HostgroupTableRow.php b/library/Icingadb/Widget/ItemTable/HostgroupTableRow.php index 6aa61c271..cb3f06a9a 100644 --- a/library/Icingadb/Widget/ItemTable/HostgroupTableRow.php +++ b/library/Icingadb/Widget/ItemTable/HostgroupTableRow.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Icingadb\Widget\ItemTable; -use Icinga\Module\Icingadb\Model\Hostgroup; +use Icinga\Module\Icingadb\Model\Hostgroupsummary; use Icinga\Module\Icingadb\Widget\Detail\HostStatistics; use Icinga\Module\Icingadb\Widget\Detail\ServiceStatistics; use ipl\Html\BaseHtmlElement; @@ -13,7 +13,7 @@ /** * Hostgroup table row of a hostgroup table. Represents one database row. * - * @property Hostgroup $item + * @property Hostgroupsummary $item * @property HostgroupTable $table */ class HostgroupTableRow extends BaseHostGroupItem diff --git a/library/Icingadb/Widget/ItemTable/ServicegroupTableRow.php b/library/Icingadb/Widget/ItemTable/ServicegroupTableRow.php index 3dea4c1e5..e34c029ff 100644 --- a/library/Icingadb/Widget/ItemTable/ServicegroupTableRow.php +++ b/library/Icingadb/Widget/ItemTable/ServicegroupTableRow.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Icingadb\Widget\ItemTable; -use Icinga\Module\Icingadb\Model\Servicegroup; +use Icinga\Module\Icingadb\Model\ServicegroupSummary; use Icinga\Module\Icingadb\Widget\Detail\ServiceStatistics; use ipl\Html\BaseHtmlElement; use ipl\Stdlib\Filter; @@ -12,7 +12,7 @@ /** * Servicegroup item of a servicegroup list. Represents one database row. * - * @property Servicegroup $item + * @property ServicegroupSummary $item * @property ServicegroupTable $table */ class ServicegroupTableRow extends BaseServiceGroupItem