@@ -204,6 +204,6 @@ |
||
204 | 204 | $item = $this->typeMapper->getMapping($type); |
205 | 205 | } |
206 | 206 | |
207 | - return $this->hydrate($item, $attributes, (string) $attributes['id']); |
|
207 | + return $this->hydrate($item, $attributes, (string)$attributes['id']); |
|
208 | 208 | } |
209 | 209 | } |
@@ -75,10 +75,10 @@ discard block |
||
75 | 75 | } |
76 | 76 | |
77 | 77 | $item = $this->getItemInstance($data->type); |
78 | - $item->setId((string) $data->id); |
|
78 | + $item->setId((string)$data->id); |
|
79 | 79 | |
80 | 80 | if (property_exists($data, 'attributes')) { |
81 | - $item->fill((array) $data->attributes); |
|
81 | + $item->fill((array)$data->attributes); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | if (property_exists($data, 'relationships')) { |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | if (is_array($data)) { |
169 | 169 | return Collection::make($data) |
170 | 170 | ->map( |
171 | - function ($identifier) { |
|
171 | + function($identifier) { |
|
172 | 172 | return $this->parseRelationshipData($identifier); |
173 | 173 | } |
174 | 174 | ); |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | throw new ValidationException(sprintf('ResourceIdentifier property "id" MUST be a string, "%s" given.', gettype($data->id))); |
191 | 191 | } |
192 | 192 | |
193 | - $item = $this->getItemInstance($data->type)->setId((string) $data->id); |
|
193 | + $item = $this->getItemInstance($data->type)->setId((string)$data->id); |
|
194 | 194 | if (property_exists($data, 'meta')) { |
195 | 195 | $item->setMeta($this->metaParser->parse($data->meta)); |
196 | 196 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function forceFill(array $attributes) |
85 | 85 | { |
86 | - return static::unguarded(function () use ($attributes) { |
|
86 | + return static::unguarded(function() use ($attributes) { |
|
87 | 87 | return $this->fill($attributes); |
88 | 88 | }); |
89 | 89 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | { |
119 | 119 | $instance = new static(); |
120 | 120 | |
121 | - return array_map(static function ($item) use ($instance) { |
|
121 | + return array_map(static function($item) use ($instance) { |
|
122 | 122 | return $instance->newInstance($item); |
123 | 123 | }, $items); |
124 | 124 | } |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | public function offsetSet($offset, $value) |
381 | 381 | { |
382 | 382 | if ($offset === 'id') { |
383 | - $this->setId($value ? (string) $value : null); |
|
383 | + $this->setId($value ? (string)$value : null); |
|
384 | 384 | |
385 | 385 | return; |
386 | 386 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | public function toArray() |
119 | 119 | { |
120 | 120 | return array_map( |
121 | - static function (?Link $link) { |
|
121 | + static function(?Link $link) { |
|
122 | 122 | return $link ? $link->toArray() : null; |
123 | 123 | }, |
124 | 124 | $this->links |
@@ -145,6 +145,6 @@ discard block |
||
145 | 145 | #[\ReturnTypeWillChange] |
146 | 146 | public function jsonSerialize() |
147 | 147 | { |
148 | - return (object) $this->toArray(); |
|
148 | + return (object)$this->toArray(); |
|
149 | 149 | } |
150 | 150 | } |
@@ -76,6 +76,6 @@ |
||
76 | 76 | #[\ReturnTypeWillChange] |
77 | 77 | public function jsonSerialize() |
78 | 78 | { |
79 | - return (object) $this->toArray(); |
|
79 | + return (object)$this->toArray(); |
|
80 | 80 | } |
81 | 81 | } |
@@ -76,6 +76,6 @@ |
||
76 | 76 | #[\ReturnTypeWillChange] |
77 | 77 | public function jsonSerialize() |
78 | 78 | { |
79 | - return (object) $this->toArray(); |
|
79 | + return (object)$this->toArray(); |
|
80 | 80 | } |
81 | 81 | } |
@@ -203,13 +203,13 @@ discard block |
||
203 | 203 | private function linkRelationships(Collection $items): void |
204 | 204 | { |
205 | 205 | $keyedItems = $items->keyBy( |
206 | - function (ItemInterface $item) { |
|
206 | + function(ItemInterface $item) { |
|
207 | 207 | return $this->getItemKey($item); |
208 | 208 | } |
209 | 209 | ); |
210 | 210 | |
211 | 211 | $items->each( |
212 | - function (ItemInterface $item) use ($keyedItems) { |
|
212 | + function(ItemInterface $item) use ($keyedItems) { |
|
213 | 213 | foreach ($item->getRelations() as $name => $relation) { |
214 | 214 | if ($relation instanceof OneRelationInterface) { |
215 | 215 | /** @var \Swis\JsonApi\Client\Interfaces\ItemInterface|null $relatedItem */ |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | } |
233 | 233 | |
234 | 234 | $relation->setIncluded( |
235 | - $relatedCollection->map(function (ItemInterface $relatedItem) use ($keyedItems) { |
|
235 | + $relatedCollection->map(function(ItemInterface $relatedItem) use ($keyedItems) { |
|
236 | 236 | return $this->getItem($keyedItems, $relatedItem) ?? $relatedItem; |
237 | 237 | }) |
238 | 238 | ); |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | */ |
271 | 271 | private function getDuplicateItems(Collection $items): Collection |
272 | 272 | { |
273 | - $valueRetriever = function (ItemInterface $item) { |
|
273 | + $valueRetriever = function(ItemInterface $item) { |
|
274 | 274 | return $this->getItemKey($item); |
275 | 275 | }; |
276 | 276 |