@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | $this->query->addSelect($columns); |
| 62 | 62 | |
| 63 | - return tap($this->query->paginate($perPage, $columns, $pageName, $page), function (Paginator $paginator) { |
|
| 63 | + return tap($this->query->paginate($perPage, $columns, $pageName, $page), function(Paginator $paginator) { |
|
| 64 | 64 | $this->hydrateIntermediateRelations($paginator->items()); |
| 65 | 65 | }); |
| 66 | 66 | } |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | $this->query->addSelect($columns); |
| 85 | 85 | |
| 86 | - return tap($this->query->simplePaginate($perPage, $columns, $pageName, $page), function (Paginator $paginator) { |
|
| 86 | + return tap($this->query->simplePaginate($perPage, $columns, $pageName, $page), function(Paginator $paginator) { |
|
| 87 | 87 | $this->hydrateIntermediateRelations($paginator->items()); |
| 88 | 88 | }); |
| 89 | 89 | } |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | $this->query->addSelect($columns); |
| 108 | 108 | |
| 109 | - return tap($this->query->cursorPaginate($perPage, $columns, $cursorName, $cursor), function (CursorPaginator $paginator) { |
|
| 109 | + return tap($this->query->cursorPaginate($perPage, $columns, $cursorName, $cursor), function(CursorPaginator $paginator) { |
|
| 110 | 110 | $this->hydrateIntermediateRelations($paginator->items()); |
| 111 | 111 | }); |
| 112 | 112 | } |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | */ |
| 121 | 121 | public function chunk($count, callable $callback) |
| 122 | 122 | { |
| 123 | - return $this->prepareQueryBuilder()->chunk($count, function (Collection $results) use ($callback) { |
|
| 123 | + return $this->prepareQueryBuilder()->chunk($count, function(Collection $results) use ($callback) { |
|
| 124 | 124 | $this->hydrateIntermediateRelations($results->all()); |
| 125 | 125 | |
| 126 | 126 | return $callback($results); |
@@ -32,11 +32,11 @@ discard block |
||
| 32 | 32 | if (is_array($relation->getOwnerKeyName())) { |
| 33 | 33 | // https://github.com/topclaudy/compoships |
| 34 | 34 | $foreignKeys[] = new CompositeKey( |
| 35 | - ...(array)$relation->getOwnerKeyName() |
|
| 35 | + ...(array) $relation->getOwnerKeyName() |
|
| 36 | 36 | ); |
| 37 | 37 | |
| 38 | 38 | $localKeys[] = new CompositeKey( |
| 39 | - ...(array)$relation->getForeignKeyName() |
|
| 39 | + ...(array) $relation->getForeignKeyName() |
|
| 40 | 40 | ); |
| 41 | 41 | } else { |
| 42 | 42 | $foreignKeys[] = $relation->getOwnerKeyName(); |
@@ -91,11 +91,11 @@ discard block |
||
| 91 | 91 | if (is_array($relation->getForeignKeyName())) { |
| 92 | 92 | // https://github.com/topclaudy/compoships |
| 93 | 93 | $foreignKeys[] = new CompositeKey( |
| 94 | - ...(array)$relation->getForeignKeyName() |
|
| 94 | + ...(array) $relation->getForeignKeyName() |
|
| 95 | 95 | ); |
| 96 | 96 | |
| 97 | 97 | $localKeys[] = new CompositeKey( |
| 98 | - ...(array)$relation->getLocalKeyName() |
|
| 98 | + ...(array) $relation->getLocalKeyName() |
|
| 99 | 99 | ); |
| 100 | 100 | } else { |
| 101 | 101 | $foreignKeys[] = $relation->getForeignKeyName(); |
@@ -207,7 +207,7 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | foreach ($classes as $class) { |
| 209 | 209 | if ($relation instanceof $class) { |
| 210 | - return 'hasOneOrManyDeepFrom' . class_basename($class); |
|
| 210 | + return 'hasOneOrManyDeepFrom'.class_basename($class); |
|
| 211 | 211 | } |
| 212 | 212 | } |
| 213 | 213 | |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $related = get_class($relation->getRelated()); |
| 135 | 135 | |
| 136 | 136 | if ((new $related())->getTable() !== $relation->getRelated()->getTable()) { |
| 137 | - $related .= ' from ' . $relation->getRelated()->getTable(); |
|
| 137 | + $related .= ' from '.$relation->getRelated()->getTable(); |
|
| 138 | 138 | } |
| 139 | 139 | } else { |
| 140 | 140 | $through[] = $this->hasOneOrManyThroughParent($relation, $relations[$i + 1]); |
@@ -165,11 +165,11 @@ discard block |
||
| 165 | 165 | $through = get_class($relation->getRelated()); |
| 166 | 166 | |
| 167 | 167 | if ($relation instanceof ConcatenableRelation && method_exists($relation, 'getTableForDeepRelationship')) { |
| 168 | - return $through . ' from ' . $relation->getTableForDeepRelationship(); |
|
| 168 | + return $through.' from '.$relation->getTableForDeepRelationship(); |
|
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | if ((new $through())->getTable() !== $relation->getRelated()->getTable()) { |
| 172 | - $through .= ' from ' . $relation->getRelated()->getTable(); |
|
| 172 | + $through .= ' from '.$relation->getRelated()->getTable(); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | if (get_class($relation->getRelated()) === get_class($successor->getParent())) { |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | $segments = explode(' as ', $table); |
| 179 | 179 | |
| 180 | 180 | if (isset($segments[1])) { |
| 181 | - $through .= ' as ' . $segments[1]; |
|
| 181 | + $through .= ' as '.$segments[1]; |
|
| 182 | 182 | } |
| 183 | 183 | } |
| 184 | 184 | |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | ?callable $customThroughKeyCallback, |
| 202 | 202 | ?callable $customEagerConstraintsCallback, |
| 203 | 203 | ?callable $customEagerMatchingCallback |
| 204 | - ): HasManyDeep|HasOneDeep { |
|
| 204 | + ): HasManyDeep | HasOneDeep { |
|
| 205 | 205 | $relation->withPostGetCallbacks($postGetCallbacks); |
| 206 | 206 | |
| 207 | 207 | if ($customThroughKeyCallback) { |
@@ -255,11 +255,11 @@ discard block |
||
| 255 | 255 | protected function addConstraintsToHasOneOrManyDeepRelationship( |
| 256 | 256 | HasManyDeep $deepRelation, |
| 257 | 257 | array $relations |
| 258 | - ): HasManyDeep|HasOneDeep { |
|
| 258 | + ): HasManyDeep | HasOneDeep { |
|
| 259 | 259 | $relations = $this->normalizeVariadicRelations($relations); |
| 260 | 260 | |
| 261 | 261 | foreach ($relations as $i => $relation) { |
| 262 | - $relationWithoutConstraints = Relation::noConstraints(function () use ($relation) { |
|
| 262 | + $relationWithoutConstraints = Relation::noConstraints(function() use ($relation) { |
|
| 263 | 263 | return $relation(); |
| 264 | 264 | }); |
| 265 | 265 | |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | $deepRelation->withTrashed($deletedAtColumn); |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | - if (str_starts_with($scope, HasManyDeep::class . ':')) { |
|
| 311 | + if (str_starts_with($scope, HasManyDeep::class.':')) { |
|
| 312 | 312 | $deletedAtColumn = explode(':', $scope)[1]; |
| 313 | 313 | |
| 314 | 314 | $deepRelation->withTrashed($deletedAtColumn); |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | if ($this->customThroughKeyCallback) { |
| 205 | 205 | $columns[] = ($this->customThroughKeyCallback)($alias); |
| 206 | 206 | } else { |
| 207 | - $columns[] = $this->getQualifiedFirstKeyName() . " as $alias"; |
|
| 207 | + $columns[] = $this->getQualifiedFirstKeyName()." as $alias"; |
|
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | if ($this->hasLeadingCompositeKey()) { |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | ); |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | - $table = $throughParent->getTable() . ' as ' . $this->getRelationCountHash(); |
|
| 244 | + $table = $throughParent->getTable().' as '.$this->getRelationCountHash(); |
|
| 245 | 245 | |
| 246 | 246 | $throughParent->setTable($table); |
| 247 | 247 | |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | foreach ($columns as $column) { |
| 319 | - $this->query->withoutGlobalScope(__CLASS__ . ":$column"); |
|
| 319 | + $this->query->withoutGlobalScope(__CLASS__.":$column"); |
|
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | return $this; |