@@ -306,16 +306,16 @@ discard block |
||
306 | 306 | switch ($this->getCastType($key)) { |
307 | 307 | case 'int': |
308 | 308 | case 'integer': |
309 | - return (int) $value; |
|
309 | + return (int)$value; |
|
310 | 310 | case 'real': |
311 | 311 | case 'float': |
312 | 312 | case 'double': |
313 | 313 | return $this->fromFloat($value); |
314 | 314 | case 'string': |
315 | - return (string) $value; |
|
315 | + return (string)$value; |
|
316 | 316 | case 'bool': |
317 | 317 | case 'boolean': |
318 | - return (bool) $value; |
|
318 | + return (bool)$value; |
|
319 | 319 | case 'object': |
320 | 320 | return $this->fromJson($value, true); |
321 | 321 | case 'array': |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | */ |
426 | 426 | public function fromFloat($value) |
427 | 427 | { |
428 | - switch ((string) $value) { |
|
428 | + switch ((string)$value) { |
|
429 | 429 | case 'Infinity': |
430 | 430 | return INF; |
431 | 431 | case '-Infinity': |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | case 'NaN': |
434 | 434 | return NAN; |
435 | 435 | default: |
436 | - return (float) $value; |
|
436 | + return (float)$value; |
|
437 | 437 | } |
438 | 438 | } |
439 | 439 | |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | public function hasCast($key, $types = null) |
449 | 449 | { |
450 | 450 | if (array_key_exists($key, $this->getCasts())) { |
451 | - return $types ? in_array($this->getCastType($key), (array) $types, true) : true; |
|
451 | + return $types ? in_array($this->getCastType($key), (array)$types, true) : true; |
|
452 | 452 | } |
453 | 453 | |
454 | 454 | return false; |
@@ -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 | } |