Completed
Pull Request — master (#22)
by
unknown
11:53
created
src/JsonApi/Parser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@
 block discarded – undo
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)) {
Please login to merge, or discard this patch.
src/JsonApi/Hydrator.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -69,11 +69,11 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         );
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
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
             }
Please login to merge, or discard this patch.