@@ -145,7 +145,7 @@ |
||
| 145 | 145 | $desiredObject = null; |
| 146 | 146 | |
| 147 | 147 | //check duplicate |
| 148 | - $desiredObject = $included->first(function ($item) use ($id, $type) { |
|
| 148 | + $desiredObject = $included->first(function($item) use ($id, $type) { |
|
| 149 | 149 | return ($item->getId() == $id) && ($item->getType() == $type); |
| 150 | 150 | }); |
| 151 | 151 | if (is_null($desiredObject)) { |
@@ -69,11 +69,11 @@ discard block |
||
| 69 | 69 | { |
| 70 | 70 | $collection = new Collection(); |
| 71 | 71 | foreach ($jsonApiCollection->asArray() as $item) { |
| 72 | - $returnItem=$this->hydrateRelationItem($item); |
|
| 73 | - if($returnItem instanceof Collection) |
|
| 72 | + $returnItem = $this->hydrateRelationItem($item); |
|
| 73 | + if ($returnItem instanceof Collection) |
|
| 74 | 74 | { |
| 75 | - $collection= $collection->merge($returnItem); |
|
| 76 | - }else{ |
|
| 75 | + $collection = $collection->merge($returnItem); |
|
| 76 | + } else { |
|
| 77 | 77 | $collection->push($this->hydrateRelationItem($item)); |
| 78 | 78 | |
| 79 | 79 | } |
@@ -113,13 +113,13 @@ discard block |
||
| 113 | 113 | public function hydrateRelationships(Collection $jsonApiItems, Collection $items) |
| 114 | 114 | { |
| 115 | 115 | $keyedItems = $items->reverse()->keyBy( |
| 116 | - function (ItemInterface $item) { |
|
| 116 | + function(ItemInterface $item) { |
|
| 117 | 117 | return $this->getItemKey($item); |
| 118 | 118 | } |
| 119 | 119 | ); |
| 120 | 120 | |
| 121 | 121 | $jsonApiItems->each( |
| 122 | - function ( $jsonApiItem) use ($keyedItems) { |
|
| 122 | + function($jsonApiItem) use ($keyedItems) { |
|
| 123 | 123 | if (!$jsonApiItem->has('relationships')) { |
| 124 | 124 | return; |
| 125 | 125 | } |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | { |
| 178 | 178 | return $included->get( |
| 179 | 179 | $this->getElementKey($identifier), |
| 180 | - function () { |
|
| 180 | + function() { |
|
| 181 | 181 | return new NullItem(); |
| 182 | 182 | } |
| 183 | 183 | ); |
@@ -73,7 +73,7 @@ |
||
| 73 | 73 | if($returnItem instanceof Collection) |
| 74 | 74 | { |
| 75 | 75 | $collection= $collection->merge($returnItem); |
| 76 | - }else{ |
|
| 76 | + } else{ |
|
| 77 | 77 | $collection->push($this->hydrateRelationItem($item)); |
| 78 | 78 | |
| 79 | 79 | } |