Skip to content

Commit

Permalink
+ Added generics
Browse files Browse the repository at this point in the history
  • Loading branch information
tylernathanreed authored Dec 13, 2024
1 parent ae5b186 commit df4012a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/EloquentJoinClause.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<Model>
*/
public Eloquent $eloquent;

Check failure on line 26 in src/EloquentJoinClause.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2)

PHPDoc tag @var for property Reedware\LaravelRelationJoins\EloquentJoinClause::$eloquent contains generic type Illuminate\Database\Eloquent\Builder<Illuminate\Database\Eloquent\Model> but class Illuminate\Database\Eloquent\Builder is not generic.

Check failure on line 26 in src/EloquentJoinClause.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3)

PHPDoc tag @var for property Reedware\LaravelRelationJoins\EloquentJoinClause::$eloquent contains generic type Illuminate\Database\Eloquent\Builder<Illuminate\Database\Eloquent\Model> but class Illuminate\Database\Eloquent\Builder is not generic.

Check failure on line 26 in src/EloquentJoinClause.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.4)

PHPDoc tag @var for property Reedware\LaravelRelationJoins\EloquentJoinClause::$eloquent contains generic type Illuminate\Database\Eloquent\Builder<Illuminate\Database\Eloquent\Model> but class Illuminate\Database\Eloquent\Builder is not generic.

Expand All @@ -27,6 +32,8 @@ class EloquentJoinClause extends JoinClause

/**
* Create a new join clause instance.
*
* @param TModel $model
*/
public function __construct(JoinClause $parentJoin, Model $model)
{
Expand Down Expand Up @@ -74,6 +81,8 @@ public function applyScopes(): static

/**
* Returns a new query builder for the model's table.
*
* @return Eloquent<TModel>
*/
public function newEloquentQuery(): Eloquent

Check failure on line 87 in src/EloquentJoinClause.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2)

PHPDoc tag @return contains generic type Illuminate\Database\Eloquent\Builder<Illuminate\Database\Eloquent\Model> but class Illuminate\Database\Eloquent\Builder is not generic.

Check failure on line 87 in src/EloquentJoinClause.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3)

PHPDoc tag @return contains generic type Illuminate\Database\Eloquent\Builder<Illuminate\Database\Eloquent\Model> but class Illuminate\Database\Eloquent\Builder is not generic.

Check failure on line 87 in src/EloquentJoinClause.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.4)

PHPDoc tag @return contains generic type Illuminate\Database\Eloquent\Builder<Illuminate\Database\Eloquent\Model> but class Illuminate\Database\Eloquent\Builder is not generic.
{
Expand All @@ -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<TModel>
*/
public function newModelQuery(): Eloquent

Check failure on line 99 in src/EloquentJoinClause.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2)

PHPDoc tag @return contains generic type Illuminate\Database\Eloquent\Builder<Illuminate\Database\Eloquent\Model> but class Illuminate\Database\Eloquent\Builder is not generic.

Check failure on line 99 in src/EloquentJoinClause.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3)

PHPDoc tag @return contains generic type Illuminate\Database\Eloquent\Builder<Illuminate\Database\Eloquent\Model> but class Illuminate\Database\Eloquent\Builder is not generic.

Check failure on line 99 in src/EloquentJoinClause.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.4)

PHPDoc tag @return contains generic type Illuminate\Database\Eloquent\Builder<Illuminate\Database\Eloquent\Model> but class Illuminate\Database\Eloquent\Builder is not generic.
{
Expand All @@ -92,9 +103,12 @@ public function newModelQuery(): Eloquent

/**
* Returns a new eloquent builder for this join clause.
*
* @return Eloquent<TModel>
*/
public function newEloquentBuilder(): Eloquent

Check failure on line 109 in src/EloquentJoinClause.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2)

PHPDoc tag @return contains generic type Illuminate\Database\Eloquent\Builder<Illuminate\Database\Eloquent\Model> but class Illuminate\Database\Eloquent\Builder is not generic.

Check failure on line 109 in src/EloquentJoinClause.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3)

PHPDoc tag @return contains generic type Illuminate\Database\Eloquent\Builder<Illuminate\Database\Eloquent\Model> but class Illuminate\Database\Eloquent\Builder is not generic.

Check failure on line 109 in src/EloquentJoinClause.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.4)

PHPDoc tag @return contains generic type Illuminate\Database\Eloquent\Builder<Illuminate\Database\Eloquent\Model> but class Illuminate\Database\Eloquent\Builder is not generic.
{
/** @var Eloquent<TModel> */
return new Eloquent($this);

Check failure on line 112 in src/EloquentJoinClause.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.2)

PHPDoc tag @var contains generic type Illuminate\Database\Eloquent\Builder<Illuminate\Database\Eloquent\Model> but class Illuminate\Database\Eloquent\Builder is not generic.

Check failure on line 112 in src/EloquentJoinClause.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.3)

PHPDoc tag @var contains generic type Illuminate\Database\Eloquent\Builder<Illuminate\Database\Eloquent\Model> but class Illuminate\Database\Eloquent\Builder is not generic.

Check failure on line 112 in src/EloquentJoinClause.php

View workflow job for this annotation

GitHub Actions / Static Analysis (8.4)

PHPDoc tag @var contains generic type Illuminate\Database\Eloquent\Builder<Illuminate\Database\Eloquent\Model> but class Illuminate\Database\Eloquent\Builder is not generic.
}

Expand Down

0 comments on commit df4012a

Please sign in to comment.