Skip to content

Commit

Permalink
dataset: Typangaben wieder korrigiert
Browse files Browse the repository at this point in the history
  • Loading branch information
gharlan committed Oct 5, 2023
1 parent f24a739 commit f25bf05
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions plugins/manager/lib/yform/manager/dataset.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
{
Expand All @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -177,7 +179,7 @@ public static function queryOne(string $query, array $params = [], ?string $tabl
}

/**
* @return rex_yform_manager_collection<static>|rex_yform_manager_collection<rex_yform_manager_dataset>
* @return rex_yform_manager_collection<static>
*/
public static function queryCollection(string $query, array $params = [], ?string $table = null): rex_yform_manager_collection
{
Expand Down Expand Up @@ -212,11 +214,11 @@ public static function setModelClass(string $table, string $modelClass): void
}

/**
* @return null|class-string<self>
* @return null|class-string<static>
*/
public static function getModelClass(string $table): ?string
{
return self::$tableToModel[$table] ?? null;
return self::$tableToModel[$table] ?? null; // @phpstan-ignore-line
}

public function getTableName(): string
Expand Down Expand Up @@ -257,6 +259,7 @@ public function hasValue(string $key): bool
}

/**
* @param mixed $value
* @return $this
*/
public function setValue(string $key, $value): self
Expand All @@ -271,6 +274,9 @@ public function setValue(string $key, $value): self
return $this;
}

/**
* @return mixed
*/
public function getValue(string $key)
{
if ('id' === $key) {
Expand Down Expand Up @@ -649,11 +655,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);
Expand Down

0 comments on commit f25bf05

Please sign in to comment.