From ca620814c371ff4332a12a7b1d9403ce0b5722fe Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Thu, 28 Mar 2024 12:01:16 +0100 Subject: [PATCH 1/2] Storage: Define type of generic class `ConfigObject` --- library/Businessprocess/Storage/Storage.php | 4 ++-- phpstan-baseline-standard.neon | 10 ---------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/library/Businessprocess/Storage/Storage.php b/library/Businessprocess/Storage/Storage.php index c8a07ba0..12bdc558 100644 --- a/library/Businessprocess/Storage/Storage.php +++ b/library/Businessprocess/Storage/Storage.php @@ -15,13 +15,13 @@ abstract class Storage protected static $instance; /** - * @var ConfigObject + * @var ConfigObject */ protected $config; /** * Storage constructor. - * @param ConfigObject $config + * @param ConfigObject $config */ public function __construct(ConfigObject $config) { diff --git a/phpstan-baseline-standard.neon b/phpstan-baseline-standard.neon index ebd45d27..d7aa531d 100644 --- a/phpstan-baseline-standard.neon +++ b/phpstan-baseline-standard.neon @@ -3570,11 +3570,6 @@ parameters: count: 1 path: library/Businessprocess/Storage/LegacyStorage.php - - - message: "#^Method Icinga\\\\Module\\\\Businessprocess\\\\Storage\\\\Storage\\:\\:__construct\\(\\) has parameter \\$config with generic class Icinga\\\\Data\\\\ConfigObject but does not specify its types\\: TValue$#" - count: 1 - path: library/Businessprocess/Storage/Storage.php - - message: "#^Method Icinga\\\\Module\\\\Businessprocess\\\\Storage\\\\Storage\\:\\:deleteProcess\\(\\) has parameter \\$name with no type specified\\.$#" count: 1 @@ -3615,11 +3610,6 @@ parameters: count: 1 path: library/Businessprocess/Storage/Storage.php - - - message: "#^Property Icinga\\\\Module\\\\Businessprocess\\\\Storage\\\\Storage\\:\\:\\$config with generic class Icinga\\\\Data\\\\ConfigObject does not specify its types\\: TValue$#" - count: 1 - path: library/Businessprocess/Storage/Storage.php - - message: "#^Method Icinga\\\\Module\\\\Businessprocess\\\\Web\\\\Component\\\\BpDashboardTile\\:\\:__construct\\(\\) has parameter \\$attributes with no type specified\\.$#" count: 1 From 980ea85e61db056b7256cff2e4fc4d5ccbaeb1e3 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Thu, 28 Mar 2024 12:21:49 +0100 Subject: [PATCH 2/2] Sort: Remove var type hint change This should be fixed in ipl/stdlib --- library/Businessprocess/Common/Sort.php | 1 - 1 file changed, 1 deletion(-) diff --git a/library/Businessprocess/Common/Sort.php b/library/Businessprocess/Common/Sort.php index 01bb569f..0dfc2484 100644 --- a/library/Businessprocess/Common/Sort.php +++ b/library/Businessprocess/Common/Sort.php @@ -41,7 +41,6 @@ public function setSort(?string $sort): self return $this; } - /** @var array $res */ $res = Str::symmetricSplit($sort, ' ', 2, 'asc'); [$sortBy, $direction] = $res;