From df4012a4de34b086c3bc7199a7a4988e39d8c21c Mon Sep 17 00:00:00 2001 From: Tyler Date: Fri, 13 Dec 2024 14:50:29 -0600 Subject: [PATCH] + Added generics --- src/EloquentJoinClause.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/EloquentJoinClause.php b/src/EloquentJoinClause.php index 39bcf1c..934c145 100644 --- a/src/EloquentJoinClause.php +++ b/src/EloquentJoinClause.php @@ -8,15 +8,20 @@ use Illuminate\Database\Query\JoinClause; use ReflectionClass; +/** @template TModel of Model */ class EloquentJoinClause extends JoinClause { /** * The model associated to this join. + * + * @var TModel */ public Model $model; /** * The eloquent query representing this join. + * + * @var Eloquent */ public Eloquent $eloquent; @@ -27,6 +32,8 @@ class EloquentJoinClause extends JoinClause /** * Create a new join clause instance. + * + * @param TModel $model */ public function __construct(JoinClause $parentJoin, Model $model) { @@ -74,6 +81,8 @@ public function applyScopes(): static /** * Returns a new query builder for the model's table. + * + * @return Eloquent */ public function newEloquentQuery(): Eloquent { @@ -84,6 +93,8 @@ public function newEloquentQuery(): Eloquent /** * Returns a new eloquent builder that doesn't have any global scopes or eager loading. + * + * @return Eloquent */ public function newModelQuery(): Eloquent { @@ -92,9 +103,12 @@ public function newModelQuery(): Eloquent /** * Returns a new eloquent builder for this join clause. + * + * @return Eloquent */ public function newEloquentBuilder(): Eloquent { + /** @var Eloquent */ return new Eloquent($this); }