From ac078b6e68d97991292353afe7e1e42cda415a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 7 Oct 2025 10:30:15 +0200 Subject: [PATCH] chore: Fix typing in WizardResult MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet Signed-off-by: Louis Chmn --- apps/user_ldap/lib/WizardResult.php | 36 ++++++++++++++++------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/apps/user_ldap/lib/WizardResult.php b/apps/user_ldap/lib/WizardResult.php index d6fd67d4204..b1fa715cc10 100644 --- a/apps/user_ldap/lib/WizardResult.php +++ b/apps/user_ldap/lib/WizardResult.php @@ -1,52 +1,56 @@ + */ + protected array $changes = []; + /** + * @var array + */ + protected array $options = []; + protected bool $markedChange = false; /** - * @param string $key - * @param mixed $value + * @param int|string|int[]|string[] $value */ - public function addChange($key, $value) { + public function addChange(string $key, int|string|array $value): void { $this->changes[$key] = $value; } - public function markChange() { + public function markChange(): void { $this->markedChange = true; } /** - * @param string $key - * @param array|string $values + * @param string|string[] $values */ - public function addOptions($key, $values) { + public function addOptions(string $key, string|array $values): void { if (!is_array($values)) { $values = [$values]; } $this->options[$key] = $values; } - /** - * @return bool - */ - public function hasChanges() { + public function hasChanges(): bool { return (count($this->changes) > 0 || $this->markedChange); } /** - * @return array + * @return array{changes:array,options?:array} */ - public function getResultArray() { + public function getResultArray(): array { $result = []; $result['changes'] = $this->changes; if (count($this->options) > 0) {