From 03e8fa368025ccf2848c9d06c00eacc08808bc21 Mon Sep 17 00:00:00 2001 From: Gregor Harlan Date: Mon, 8 Jan 2024 14:23:13 +0100 Subject: [PATCH] dataset: Typangaben wieder korrigiert (#1454) --- plugins/manager/lib/yform/manager/dataset.php | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/plugins/manager/lib/yform/manager/dataset.php b/plugins/manager/lib/yform/manager/dataset.php index 5074fa6a..c28d21ab 100644 --- a/plugins/manager/lib/yform/manager/dataset.php +++ b/plugins/manager/lib/yform/manager/dataset.php @@ -59,6 +59,7 @@ public static function create(?string $table = null): self return $dataset; } + /** @return null|static */ public static function get(int $id, ?string $table = null): ?self { if ($id <= 0) { @@ -81,6 +82,7 @@ public static function get(int $id, ?string $table = null): ?self /** * @throws rex_exception if dataset does not exist + * @return static */ public static function require(int $id, ?string $table = null): self { @@ -96,7 +98,7 @@ public static function require(int $id, ?string $table = null): self } /** - * @return static|rex_yform_manager_dataset + * @return static */ public static function getRaw(int $id, ?string $table = null): self { @@ -147,7 +149,7 @@ public static function query(?string $table = null): rex_yform_manager_query } /** - * @return null|static|rex_yform_manager_dataset + * @return null|static */ public static function queryOne(string $query, array $params = [], ?string $table = null): ?self { @@ -177,7 +179,7 @@ public static function queryOne(string $query, array $params = [], ?string $tabl } /** - * @return rex_yform_manager_collection|rex_yform_manager_collection + * @return rex_yform_manager_collection */ public static function queryCollection(string $query, array $params = [], ?string $table = null): rex_yform_manager_collection { @@ -212,11 +214,11 @@ public static function setModelClass(string $table, string $modelClass): void } /** - * @return null|class-string + * @return null|class-string */ public static function getModelClass(string $table): ?string { - return self::$tableToModel[$table] ?? null; + return self::$tableToModel[$table] ?? null; // @phpstan-ignore-line } public function getTableName(): string @@ -257,6 +259,7 @@ public function hasValue(string $key): bool } /** + * @param mixed $value * @return $this */ public function setValue(string $key, $value): self @@ -271,6 +274,9 @@ public function setValue(string $key, $value): self return $this; } + /** + * @return mixed + */ public function getValue(string $key) { if ('id' === $key) { @@ -650,11 +656,17 @@ public function __isset(string $key): bool return $this->hasValue($key); } + /** + * @return mixed + */ public function __get(string $key) { return $this->getValue($key); } + /** + * @param mixed $value + */ public function __set(string $key, $value): void { $this->setValue($key, $value);