@@ -321,10 +321,10 @@ discard block |
||
321 | 321 | public function hasManyThroughJson( |
322 | 322 | string $related, |
323 | 323 | string $through, |
324 | - string|JsonKey $firstKey, |
|
324 | + string | JsonKey $firstKey, |
|
325 | 325 | ?string $secondKey = null, |
326 | 326 | ?string $localKey = null, |
327 | - string|JsonKey|null $secondLocalKey = null |
|
327 | + string | JsonKey | null $secondLocalKey = null |
|
328 | 328 | ) { |
329 | 329 | $relationships = []; |
330 | 330 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | } else { |
338 | 338 | if (!method_exists($through, 'belongsToJson')) { |
339 | 339 | //@codeCoverageIgnoreStart |
340 | - $message = 'Please add the HasJsonRelationships trait to the ' . $through::class . ' model.'; |
|
340 | + $message = 'Please add the HasJsonRelationships trait to the '.$through::class.' model.'; |
|
341 | 341 | |
342 | 342 | throw new RuntimeException($message); |
343 | 343 | // @codeCoverageIgnoreEnd |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | /** @var \Staudenmeir\EloquentJsonRelations\Relations\HasManyJson $hasManyJson */ |
377 | 377 | $hasManyJson = $relationships[0]; |
378 | 378 | |
379 | - $postGetCallback = function (Collection $models) use ($hasManyJson, $relationships) { |
|
379 | + $postGetCallback = function(Collection $models) use ($hasManyJson, $relationships) { |
|
380 | 380 | if (isset($models[0]->laravel_through_key)) { |
381 | 381 | $hasManyJson->hydratePivotRelation( |
382 | 382 | $models, |
@@ -393,7 +393,7 @@ discard block |
||
393 | 393 | } |
394 | 394 | |
395 | 395 | $hasManyThroughJson->withCustomEagerMatchingCallback( |
396 | - function (array $models, Collection $results, string $relation) use ($hasManyJson, $hasManyThroughJson) { |
|
396 | + function(array $models, Collection $results, string $relation) use ($hasManyJson, $hasManyThroughJson) { |
|
397 | 397 | foreach ($models as $model) { |
398 | 398 | $hasManyJson->hydratePivotRelation( |
399 | 399 | $model->$relation, |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | |
412 | 412 | $path = $belongsToJson->getForeignKeyPath(); |
413 | 413 | |
414 | - $postProcessor = function (Model $model, array $attributes) use ($belongsToJson, $path) { |
|
414 | + $postProcessor = function(Model $model, array $attributes) use ($belongsToJson, $path) { |
|
415 | 415 | $records = json_decode($attributes[$path], true); |
416 | 416 | |
417 | 417 | return $belongsToJson->pivotAttributes($model, $model, $records); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | if ($position === 0) { |
25 | 25 | $foreignKeys[] = $this->ownerKey; |
26 | 26 | |
27 | - $localKeys[] = function (Builder $query, ?Builder $parentQuery = null) { |
|
27 | + $localKeys[] = function(Builder $query, ?Builder $parentQuery = null) { |
|
28 | 28 | if ($parentQuery) { |
29 | 29 | $this->getRelationExistenceQuery($this->query, $parentQuery); |
30 | 30 | } |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $this->mergeWhereConstraints($query, $this->query); |
33 | 33 | }; |
34 | 34 | } else { |
35 | - $foreignKeys[] = function (Builder $query, JoinClause $join) { |
|
35 | + $foreignKeys[] = function(Builder $query, JoinClause $join) { |
|
36 | 36 | $ownerKey = $this->query->qualifyColumn($this->ownerKey); |
37 | 37 | |
38 | 38 | [$sql, $bindings] = $this->relationExistenceQueryOwnerKey($query, $ownerKey); |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | public function appendToDeepRelationship(array $through, array $foreignKeys, array $localKeys, int $position): array |
26 | 26 | { |
27 | 27 | if ($position === 0) { |
28 | - $foreignKeys[] = function (Builder $query, ?Builder $parentQuery = null) { |
|
28 | + $foreignKeys[] = function(Builder $query, ?Builder $parentQuery = null) { |
|
29 | 29 | if ($parentQuery) { |
30 | 30 | $this->getRelationExistenceQuery($this->query, $parentQuery); |
31 | 31 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | |
36 | 36 | $localKeys[] = $this->localKey; |
37 | 37 | } else { |
38 | - $foreignKeys[] = function (Builder $query, JoinClause $join) { |
|
38 | + $foreignKeys[] = function(Builder $query, JoinClause $join) { |
|
39 | 39 | [$sql, $bindings] = $this->relationExistenceQueryParentKey($query); |
40 | 40 | |
41 | 41 | $query->addBinding($bindings, 'join'); |