@@ -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 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | */ |
| 82 | 82 | public function forceFill(array $attributes) |
| 83 | 83 | { |
| 84 | - return static::unguarded(function () use ($attributes) { |
|
| 84 | + return static::unguarded(function() use ($attributes) { |
|
| 85 | 85 | return $this->fill($attributes); |
| 86 | 86 | }); |
| 87 | 87 | } |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | { |
| 114 | 114 | $instance = new static(); |
| 115 | 115 | |
| 116 | - return array_map(static function ($item) use ($instance) { |
|
| 116 | + return array_map(static function($item) use ($instance) { |
|
| 117 | 117 | return $instance->newInstance($item); |
| 118 | 118 | }, $items); |
| 119 | 119 | } |
@@ -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; |