@@ -227,6 +227,6 @@ |
||
227 | 227 | $document['jsonapi'] = $this->getJsonapi(); |
228 | 228 | } |
229 | 229 | |
230 | - return (object) $document; |
|
230 | + return (object)$document; |
|
231 | 231 | } |
232 | 232 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | public function toArray() |
113 | 113 | { |
114 | 114 | return array_map( |
115 | - static function (?Link $link) { |
|
115 | + static function(?Link $link) { |
|
116 | 116 | return $link ? $link->toArray() : null; |
117 | 117 | }, |
118 | 118 | $this->links |
@@ -138,6 +138,6 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public function jsonSerialize() |
140 | 140 | { |
141 | - return (object) $this->toArray(); |
|
141 | + return (object)$this->toArray(); |
|
142 | 142 | } |
143 | 143 | } |
@@ -133,6 +133,6 @@ |
||
133 | 133 | */ |
134 | 134 | public function jsonSerialize() |
135 | 135 | { |
136 | - return (object) $this->toArray(); |
|
136 | + return (object)$this->toArray(); |
|
137 | 137 | } |
138 | 138 | } |
@@ -51,7 +51,7 @@ |
||
51 | 51 | { |
52 | 52 | $this->app->extend( |
53 | 53 | ClientInterface::class, |
54 | - static function (ClientInterface $client) { |
|
54 | + static function(ClientInterface $client) { |
|
55 | 55 | if ($baseUri = config('jsonapi.base_uri')) { |
56 | 56 | $client->setBaseUri($baseUri); |
57 | 57 | } |
@@ -202,13 +202,13 @@ discard block |
||
202 | 202 | private function linkRelationships(Collection $items): void |
203 | 203 | { |
204 | 204 | $keyedItems = $items->keyBy( |
205 | - function (ItemInterface $item) { |
|
205 | + function(ItemInterface $item) { |
|
206 | 206 | return $this->getItemKey($item); |
207 | 207 | } |
208 | 208 | ); |
209 | 209 | |
210 | 210 | $items->each( |
211 | - function (ItemInterface $item) use ($keyedItems) { |
|
211 | + function(ItemInterface $item) use ($keyedItems) { |
|
212 | 212 | foreach ($item->getRelations() as $name => $relation) { |
213 | 213 | if ($relation instanceof OneRelationInterface) { |
214 | 214 | /** @var \Swis\JsonApi\Client\Interfaces\ItemInterface|null $relatedItem */ |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | */ |
268 | 268 | private function getDuplicateItems(Collection $items): Collection |
269 | 269 | { |
270 | - $valueRetriever = function (ItemInterface $item) { |
|
270 | + $valueRetriever = function(ItemInterface $item) { |
|
271 | 271 | return $this->getItemKey($item); |
272 | 272 | }; |
273 | 273 |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | |
495 | 495 | $attributes[$key] = $this->mutateAttributeForArray( |
496 | 496 | $key, $attributes[$key] |
497 | - ); |
|
497 | + ); |
|
498 | 498 | } |
499 | 499 | |
500 | 500 | // Next we will handle any casts that have been setup for this model and cast |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | |
509 | 509 | $attributes[$key] = $this->castAttribute( |
510 | 510 | $key, $attributes[$key] |
511 | - ); |
|
511 | + ); |
|
512 | 512 | } |
513 | 513 | |
514 | 514 | // Here we will grab all of the appended, calculated attributes to this model |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | } |
544 | 544 | |
545 | 545 | return $this->getArrayableItems( |
546 | - array_combine($this->appends, $this->appends) |
|
546 | + array_combine($this->appends, $this->appends) |
|
547 | 547 | ); |
548 | 548 | } |
549 | 549 | |
@@ -710,26 +710,26 @@ discard block |
||
710 | 710 | } |
711 | 711 | |
712 | 712 | switch ($this->getCastType($key)) { |
713 | - case 'int': |
|
713 | + case 'int': |
|
714 | 714 | case 'integer': |
715 | 715 | return (int) $value; |
716 | - case 'real': |
|
716 | + case 'real': |
|
717 | 717 | case 'float': |
718 | 718 | case 'double': |
719 | 719 | return (float) $value; |
720 | - case 'string': |
|
720 | + case 'string': |
|
721 | 721 | return (string) $value; |
722 | - case 'bool': |
|
722 | + case 'bool': |
|
723 | 723 | case 'boolean': |
724 | 724 | return (bool) $value; |
725 | - case 'object': |
|
725 | + case 'object': |
|
726 | 726 | return $this->fromJson($value, true); |
727 | - case 'array': |
|
727 | + case 'array': |
|
728 | 728 | case 'json': |
729 | 729 | return $this->fromJson($value); |
730 | - case 'collection': |
|
730 | + case 'collection': |
|
731 | 731 | return Collection::wrap($this->fromJson($value)); |
732 | - default: |
|
732 | + default: |
|
733 | 733 | return $value; |
734 | 734 | } |
735 | 735 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | // the model in a variable, which we will then use in the closure. |
136 | 136 | $model = $this; |
137 | 137 | |
138 | - return static::unguarded(function () use ($model, $attributes) { |
|
138 | + return static::unguarded(function() use ($model, $attributes) { |
|
139 | 139 | return $model->fill($attributes); |
140 | 140 | }); |
141 | 141 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | */ |
166 | 166 | public function newInstance(array $attributes = []) |
167 | 167 | { |
168 | - return new static((array) $attributes); |
|
168 | + return new static((array)$attributes); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | { |
180 | 180 | $instance = new static(); |
181 | 181 | |
182 | - $items = array_map(function ($item) use ($instance) { |
|
182 | + $items = array_map(function($item) use ($instance) { |
|
183 | 183 | return $instance->newInstance($item); |
184 | 184 | }, $items); |
185 | 185 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | */ |
234 | 234 | public function withHidden($attributes) |
235 | 235 | { |
236 | - $this->hidden = array_diff($this->hidden, (array) $attributes); |
|
236 | + $this->hidden = array_diff($this->hidden, (array)$attributes); |
|
237 | 237 | |
238 | 238 | return $this; |
239 | 239 | } |
@@ -712,16 +712,16 @@ discard block |
||
712 | 712 | switch ($this->getCastType($key)) { |
713 | 713 | case 'int': |
714 | 714 | case 'integer': |
715 | - return (int) $value; |
|
715 | + return (int)$value; |
|
716 | 716 | case 'real': |
717 | 717 | case 'float': |
718 | 718 | case 'double': |
719 | - return (float) $value; |
|
719 | + return (float)$value; |
|
720 | 720 | case 'string': |
721 | - return (string) $value; |
|
721 | + return (string)$value; |
|
722 | 722 | case 'bool': |
723 | 723 | case 'boolean': |
724 | - return (bool) $value; |
|
724 | + return (bool)$value; |
|
725 | 725 | case 'object': |
726 | 726 | return $this->fromJson($value, true); |
727 | 727 | case 'array': |