Skip to content

Commit 8f8235f

Browse files
authored
[12.x] add generics to aggregate related methods and properties (#55628)
* [12.x] add generics to aggregate related methods * revert unrelated
1 parent 9b076c9 commit 8f8235f

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/Illuminate/Database/Query/Builder.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ class Builder implements BuilderContract
9090
/**
9191
* An aggregate function and column to be run.
9292
*
93-
* @var array|null
93+
* @var array{
94+
* function: string,
95+
* columns: array<\Illuminate\Contracts\Database\Query\Expression|string>
96+
* }|null
9497
*/
9598
public $aggregate;
9699

@@ -3653,7 +3656,7 @@ public function numericAggregate($function, $columns = ['*'])
36533656
* Set the aggregate property without running the query.
36543657
*
36553658
* @param string $function
3656-
* @param array $columns
3659+
* @param array<\Illuminate\Contracts\Database\Query\Expression|string> $columns
36573660
* @return $this
36583661
*/
36593662
protected function setAggregate($function, $columns)

src/Illuminate/Database/Query/Grammars/Grammar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ protected function compileComponents(Builder $query)
123123
* Compile an aggregated select clause.
124124
*
125125
* @param \Illuminate\Database\Query\Builder $query
126-
* @param array $aggregate
126+
* @param array{function: string, columns: array<\Illuminate\Contracts\Database\Query\Expression|string>} $aggregate
127127
* @return string
128128
*/
129129
protected function compileAggregate(Builder $query, $aggregate)

0 commit comments

Comments
 (0)