diff --git a/lib/ActiveRecord.php b/lib/ActiveRecord.php index 73fc2a6..f0ac9f7 100644 --- a/lib/ActiveRecord.php +++ b/lib/ActiveRecord.php @@ -29,7 +29,7 @@ * @see self::get_primary_key_value() * @property-read TKey $primary_key_value The value of the primary key. * - * @template TKey of int|non-empty-string|non-empty-array + * @template TKey of scalar|non-empty-array */ abstract class ActiveRecord extends Prototyped { diff --git a/lib/ActiveRecord/Model.php b/lib/ActiveRecord/Model.php index bb129ee..bf06faf 100644 --- a/lib/ActiveRecord/Model.php +++ b/lib/ActiveRecord/Model.php @@ -15,7 +15,7 @@ /** * Base class for activerecord models. * - * @template TKey of int|non-empty-string|non-empty-string[] + * @template TKey of scalar|non-empty-array * @template TValue of ActiveRecord * * @property-read Model|null $parent Parent model. diff --git a/lib/ActiveRecord/ModelProvider.php b/lib/ActiveRecord/ModelProvider.php index 2cac981..4f1de92 100644 --- a/lib/ActiveRecord/ModelProvider.php +++ b/lib/ActiveRecord/ModelProvider.php @@ -16,7 +16,7 @@ interface ModelProvider * * @param class-string $activerecord_class * - * @phpstan-return Model + * @phpstan-return Model, T> */ public function model_for_record(string $activerecord_class): Model; } diff --git a/lib/ActiveRecord/Relation.php b/lib/ActiveRecord/Relation.php index 1d8f174..77fd3a2 100644 --- a/lib/ActiveRecord/Relation.php +++ b/lib/ActiveRecord/Relation.php @@ -73,7 +73,7 @@ protected function resolve_related_model(): Model * * @param class-string $activerecord_class * - * @return Model + * @return Model, T> */ protected function model_for_activerecord(string $activerecord_class): Model { diff --git a/lib/ActiveRecord/StaticModelProvider.php b/lib/ActiveRecord/StaticModelProvider.php index 05b51ee..81554d0 100644 --- a/lib/ActiveRecord/StaticModelProvider.php +++ b/lib/ActiveRecord/StaticModelProvider.php @@ -12,7 +12,7 @@ final class StaticModelProvider { /** - * @var (Closure(): ModelProvider)|null + * @var (Closure():ModelProvider)|null */ private static ?Closure $factory = null; @@ -21,10 +21,10 @@ final class StaticModelProvider /** * Sets the {@see ModelProvider} factory. * - * @param (callable(): ModelProvider) $factory + * @param (callable():ModelProvider) $factory * The factory is invoked once: the first time {@see model_for_record} is invoked. * - * @return (callable(): ModelProvider)|null + * @return (callable():ModelProvider)|null * The previous factory, or `null` if none was defined. */ public static function set(callable $factory): ?callable @@ -40,7 +40,7 @@ public static function set(callable $factory): ?callable /** * Returns the current {@see ModelProvider} factory. * - * @return (callable(): ModelProvider)|null + * @return (callable():ModelProvider)|null */ public static function get(): ?callable { @@ -63,7 +63,7 @@ public static function reset(): void * * @param class-string $activerecord_class * - * @phpstan-return Model + * @phpstan-return Model, T> **/ public static function model_for_record(string $activerecord_class): Model {