Skip to content

Commit abf0526

Browse files
committed
Fix cs, fix phpstan
1 parent d56bfdf commit abf0526

File tree

9 files changed

+18
-13
lines changed

9 files changed

+18
-13
lines changed

src/Aggregates/AnyExists.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515
class AnyExists implements MultiRelationAggregate
1616
{
17-
/** @var \Illuminate\Support\Collection<int, \Illuminate\Database\Query\Builder> */
17+
/** @var Collection<int, QueryBuilder> */
1818
protected Collection $existenceQueries;
1919

2020
public function __construct(
@@ -43,15 +43,15 @@ public function defaultAlias(string $relation, string $column): string
4343

4444
/**
4545
* @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter
46-
* @param \Illuminate\Database\Eloquent\Builder<TModelClass> $query
46+
* @param Builder<TModelClass> $query
4747
*/
4848
public function apply(Builder $query, QueryBuilder $aggregateQuery, string $alias): void
4949
{
5050
$this->existenceQueries->add($aggregateQuery);
5151
}
5252

5353
/**
54-
* @param \Illuminate\Database\Eloquent\Builder<TModelClass> $query
54+
* @param Builder<TModelClass> $query
5555
*/
5656
public function enclose(Builder $query): void
5757
{

src/Aggregates/Contracts/AggregateFunction.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function defaultAlias(string $relation, string $column): string;
2929
* Apply the aggregateQuery in the query.
3030
* The method is executed on each relation.
3131
*
32-
* @param \Illuminate\Database\Eloquent\Builder<TModelClass> $query
32+
* @param Builder<TModelClass> $query
3333
*/
3434
public function apply(Builder $query, QueryBuilder $aggregateQuery, string $alias): void;
3535
}

src/Aggregates/Contracts/MultiRelationAggregate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ interface MultiRelationAggregate extends AggregateFunction
1414
* Enclose the aggregate on the query.
1515
* This method is executed once for all relations.
1616
*
17-
* @param \Illuminate\Database\Eloquent\Builder<TModelClass> $query
17+
* @param Builder<TModelClass> $query
1818
*/
1919
public function enclose(Builder $query): void;
2020
}

src/Aggregates/Implode.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function defaultAlias(string $relation, string $column): string
5151
}
5252

5353
/**
54-
* @param \Illuminate\Database\Eloquent\Builder<TModelClass> $query
54+
* @param Builder<TModelClass> $query
5555
*/
5656
public function apply(Builder $query, QueryBuilder $aggregateQuery, string $alias): void
5757
{

src/Mixins/CollectionMixin.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
use Illuminate\Support\Arr;
77

88
/**
9-
* @mixin \Illuminate\Database\Eloquent\Collection
9+
* @template TKey of array-key
10+
* @template TModel of \Illuminate\Database\Eloquent\Model
11+
* @mixin \Illuminate\Database\Eloquent\Collection<TKey, TModel>
1012
*/
1113
class CollectionMixin
1214
{

src/Mixins/Misc.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
use Illuminate\Database\Eloquent\Scope;
77

88
/**
9-
* @mixin \Illuminate\Database\Eloquent\Builder
9+
* @template TModel of \Illuminate\Database\Eloquent\Model
10+
* @mixin \Illuminate\Database\Eloquent\Builder<TModel>
1011
*/
1112
class Misc
1213
{

src/Mixins/Ordering.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
use function sprintf;
1111

1212
/**
13-
* @mixin \Illuminate\Database\Eloquent\Builder
13+
* @template TModel of \Illuminate\Database\Eloquent\Model
14+
* @mixin \Illuminate\Database\Eloquent\Builder<TModel>
1415
*/
1516
class Ordering
1617
{

src/Mixins/Result.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
use Illuminate\Database\Eloquent\Model;
77

88
/**
9-
* @mixin \Illuminate\Database\Eloquent\Builder
9+
* @template TModel of \Illuminate\Database\Eloquent\Model
10+
* @mixin \Illuminate\Database\Eloquent\Builder<TModel>
1011
*/
1112
class Result
1213
{

src/Mixins/Select.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414
use function is_array;
1515

1616
/**
17-
* @template TModelClass of \Illuminate\Database\Eloquent\Model
18-
* @mixin \Illuminate\Database\Eloquent\Builder<TModelClass>
17+
* @template TModel of \Illuminate\Database\Eloquent\Model
18+
* @mixin \Illuminate\Database\Eloquent\Builder<TModel>
1919
*/
2020
class Select
2121
{
2222
public function withAggregateFunction(): Closure
2323
{
2424
/**
2525
* @param array<string, Closure>|array<string>|string $relations
26-
* @param \Soyhuce\EloquentExtended\Aggregates\Contracts\AggregateFunction<TModelClass>
26+
* @param AggregateFunction<TModel>
2727
*/
2828
return function ($relations, AggregateFunction $aggregateFunction): self {
2929
if (empty($relations)) {

0 commit comments

Comments
 (0)