@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public function scopeTree(Builder $query, $maxDepth = null) |
20 | 20 | { |
21 | - $constraint = function (Builder $query) { |
|
21 | + $constraint = function(Builder $query) { |
|
22 | 22 | $query->isRoot(); |
23 | 23 | }; |
24 | 24 | |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * @param int|null $maxDepth |
34 | 34 | * @return \Illuminate\Database\Eloquent\Builder |
35 | 35 | */ |
36 | - public function scopeTreeOf(Builder $query, callable|Model $constraint, $maxDepth = null) |
|
36 | + public function scopeTreeOf(Builder $query, callable | Model $constraint, $maxDepth = null) |
|
37 | 37 | { |
38 | 38 | if ($constraint instanceof Model) { |
39 | 39 | $constraint = function($query) use ($constraint) { |
@@ -278,20 +278,20 @@ discard block |
||
278 | 278 | protected function addRecursiveQueryJoinsAndConstraints(Builder $query, $direction, $name, array $joinColumns) |
279 | 279 | { |
280 | 280 | if ($direction === 'both') { |
281 | - $query->join($name, function (JoinClause $join) use ($joinColumns) { |
|
281 | + $query->join($name, function(JoinClause $join) use ($joinColumns) { |
|
282 | 282 | $join->on($joinColumns['asc'][0], '=', $joinColumns['asc'][1]) |
283 | 283 | ->orOn($joinColumns['desc'][0], '=', $joinColumns['desc'][1]); |
284 | 284 | }); |
285 | 285 | |
286 | 286 | $depth = $this->getDepthName(); |
287 | 287 | |
288 | - $query->where(function (Builder $query) use ($depth, $joinColumns) { |
|
288 | + $query->where(function(Builder $query) use ($depth, $joinColumns) { |
|
289 | 289 | $query->where($depth, '=', 0) |
290 | - ->orWhere(function (Builder $query) use ($depth, $joinColumns) { |
|
290 | + ->orWhere(function(Builder $query) use ($depth, $joinColumns) { |
|
291 | 291 | $query->whereColumn($joinColumns['asc'][0], '=', $joinColumns['asc'][1]) |
292 | 292 | ->where($depth, '<', 0); |
293 | 293 | }) |
294 | - ->orWhere(function (Builder $query) use ($depth, $joinColumns) { |
|
294 | + ->orWhere(function(Builder $query) use ($depth, $joinColumns) { |
|
295 | 295 | $query->whereColumn($joinColumns['desc'][0], '=', $joinColumns['desc'][1]) |
296 | 296 | ->where($depth, '>', 0); |
297 | 297 | }); |