@@ -32,7 +32,7 @@ trait QueriesRelationships
32
32
* @param string $boolean
33
33
* @return \Hyperf\Database\Model\Builder|static
34
34
*/
35
- public function has ($ relation , $ operator = '>= ' , $ count = 1 , $ boolean = 'and ' , Closure $ callback = null )
35
+ public function has ($ relation , $ operator = '>= ' , $ count = 1 , $ boolean = 'and ' , ? Closure $ callback = null )
36
36
{
37
37
if (is_string ($ relation )) {
38
38
if (str_contains ($ relation , '. ' )) {
@@ -94,7 +94,7 @@ public function orHas($relation, $operator = '>=', $count = 1)
94
94
* @param string $boolean
95
95
* @return \Hyperf\Database\Model\Builder|static
96
96
*/
97
- public function doesntHave ($ relation , $ boolean = 'and ' , Closure $ callback = null )
97
+ public function doesntHave ($ relation , $ boolean = 'and ' , ? Closure $ callback = null )
98
98
{
99
99
return $ this ->has ($ relation , '< ' , 1 , $ boolean , $ callback );
100
100
}
@@ -118,7 +118,7 @@ public function orDoesntHave($relation)
118
118
* @param int $count
119
119
* @return \Hyperf\Database\Model\Builder|static
120
120
*/
121
- public function whereHas ($ relation , Closure $ callback = null , $ operator = '>= ' , $ count = 1 )
121
+ public function whereHas ($ relation , ? Closure $ callback = null , $ operator = '>= ' , $ count = 1 )
122
122
{
123
123
return $ this ->has ($ relation , $ operator , $ count , 'and ' , $ callback );
124
124
}
@@ -132,7 +132,7 @@ public function whereHas($relation, Closure $callback = null, $operator = '>=',
132
132
* @param int $count
133
133
* @return \Hyperf\Database\Model\Builder|static
134
134
*/
135
- public function orWhereHas ($ relation , Closure $ callback = null , $ operator = '>= ' , $ count = 1 )
135
+ public function orWhereHas ($ relation , ? Closure $ callback = null , $ operator = '>= ' , $ count = 1 )
136
136
{
137
137
return $ this ->has ($ relation , $ operator , $ count , 'or ' , $ callback );
138
138
}
@@ -143,7 +143,7 @@ public function orWhereHas($relation, Closure $callback = null, $operator = '>='
143
143
* @param string $relation
144
144
* @return \Hyperf\Database\Model\Builder|static
145
145
*/
146
- public function whereDoesntHave ($ relation , Closure $ callback = null )
146
+ public function whereDoesntHave ($ relation , ? Closure $ callback = null )
147
147
{
148
148
return $ this ->doesntHave ($ relation , 'and ' , $ callback );
149
149
}
@@ -155,7 +155,7 @@ public function whereDoesntHave($relation, Closure $callback = null)
155
155
* @param Closure $callback
156
156
* @return \Hyperf\Database\Model\Builder|static
157
157
*/
158
- public function orWhereDoesntHave ($ relation , Closure $ callback = null )
158
+ public function orWhereDoesntHave ($ relation , ? Closure $ callback = null )
159
159
{
160
160
return $ this ->doesntHave ($ relation , 'or ' , $ callback );
161
161
}
@@ -328,7 +328,7 @@ public function mergeConstraintsFrom(Builder $from)
328
328
* @param int $count
329
329
* @return $this
330
330
*/
331
- public function whereHasMorph ($ relation , $ types , Closure $ callback = null , $ operator = '>= ' , $ count = 1 )
331
+ public function whereHasMorph ($ relation , $ types , ? Closure $ callback = null , $ operator = '>= ' , $ count = 1 )
332
332
{
333
333
return $ this ->hasMorph ($ relation , $ types , $ operator , $ count , 'and ' , $ callback );
334
334
}
@@ -340,7 +340,7 @@ public function whereHasMorph($relation, $types, Closure $callback = null, $oper
340
340
* @param Closure $callback
341
341
* @return $this
342
342
*/
343
- public function orWhereHasMorph (string $ relation , $ types , Closure $ callback = null , string $ operator = '>= ' , int $ count = 1 )
343
+ public function orWhereHasMorph (string $ relation , $ types , ? Closure $ callback = null , string $ operator = '>= ' , int $ count = 1 )
344
344
{
345
345
return $ this ->hasMorph ($ relation , $ types , $ operator , $ count , 'or ' , $ callback );
346
346
}
@@ -351,7 +351,7 @@ public function orWhereHasMorph(string $relation, $types, Closure $callback = nu
351
351
* @param array|string $types
352
352
* @return $this
353
353
*/
354
- public function whereDoesntHaveMorph (string $ relation , $ types , Closure $ callback = null )
354
+ public function whereDoesntHaveMorph (string $ relation , $ types , ? Closure $ callback = null )
355
355
{
356
356
return $ this ->doesntHaveMorph ($ relation , $ types , 'and ' , $ callback );
357
357
}
@@ -363,7 +363,7 @@ public function whereDoesntHaveMorph(string $relation, $types, Closure $callback
363
363
* @param Closure $callback
364
364
* @return $this
365
365
*/
366
- public function orWhereDoesntHaveMorph (string $ relation , $ types , Closure $ callback = null )
366
+ public function orWhereDoesntHaveMorph (string $ relation , $ types , ? Closure $ callback = null )
367
367
{
368
368
return $ this ->doesntHaveMorph ($ relation , $ types , 'or ' , $ callback );
369
369
}
@@ -378,7 +378,7 @@ public function orWhereDoesntHaveMorph(string $relation, $types, Closure $callba
378
378
* @param string $boolean
379
379
* @return $this
380
380
*/
381
- public function hasMorph ($ relation , $ types , $ operator = '>= ' , $ count = 1 , $ boolean = 'and ' , Closure $ callback = null )
381
+ public function hasMorph ($ relation , $ types , $ operator = '>= ' , $ count = 1 , $ boolean = 'and ' , ? Closure $ callback = null )
382
382
{
383
383
$ relation = $ this ->getRelationWithoutConstraints ($ relation );
384
384
@@ -417,7 +417,7 @@ public function hasMorph($relation, $types, $operator = '>=', $count = 1, $boole
417
417
* @param string $boolean
418
418
* @return $this
419
419
*/
420
- public function doesntHaveMorph (string $ relation , $ types , $ boolean = 'and ' , Closure $ callback = null )
420
+ public function doesntHaveMorph (string $ relation , $ types , $ boolean = 'and ' , ? Closure $ callback = null )
421
421
{
422
422
return $ this ->hasMorph ($ relation , $ types , '< ' , 1 , $ boolean , $ callback );
423
423
}
0 commit comments