Completed
Pull Request — master (#45)
by Jasper
11:58
created
src/Collection.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
     public function toJsonApiArray(): array
15 15
     {
16 16
         return array_map(
17
-            function ($value) {
17
+            function($value) {
18 18
                 return $value instanceof DataInterface ? $value->toJsonApiArray() : $value;
19 19
             },
20 20
             $this->items
Please login to merge, or discard this patch.
src/JsonApi/Hydrator.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,13 +67,13 @@
 block discarded – undo
67 67
     public function hydrateRelationships(Collection $jsonApiItems, Collection $items)
68 68
     {
69 69
         $keyedItems = $items->reverse()->keyBy(
70
-            function (ItemInterface $item) {
70
+            function(ItemInterface $item) {
71 71
                 return $this->getItemKey($item);
72 72
             }
73 73
         );
74 74
 
75 75
         $jsonApiItems->each(
76
-            function (ResourceItemInterface $jsonApiItem) use ($keyedItems) {
76
+            function(ResourceItemInterface $jsonApiItem) use ($keyedItems) {
77 77
                 if (!$jsonApiItem->has('relationships')) {
78 78
                     return;
79 79
                 }
Please login to merge, or discard this patch.
src/Providers/ServiceProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
     {
46 46
         $this->app->singleton(
47 47
             TypeMapperInterface::class,
48
-            function () {
48
+            function() {
49 49
                 return new TypeMapper();
50 50
             }
51 51
         );
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
     {
56 56
         $this->app->bind(
57 57
             ParserInterface::class,
58
-            function (Application $app) {
58
+            function(Application $app) {
59 59
                 return new Parser(
60 60
                     new JsonApiClientManger(),
61 61
                     new Hydrator($app->make(TypeMapperInterface::class)),
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     {
70 70
         $this->app->bind(
71 71
             ApiClientInterface::class,
72
-            function () {
72
+            function() {
73 73
                 return new ApiClient(
74 74
                     $this->getHttpClient(),
75 75
                     config('jsonapi.base_uri'),
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 
81 81
         $this->app->bind(
82 82
             ApiDocumentClientInterface::class,
83
-            function (Application $app) {
83
+            function(Application $app) {
84 84
                 return new ApiDocumentClient(
85 85
                     $app->make(ApiClientInterface::class),
86 86
                     $app->make(ParserInterface::class)
Please login to merge, or discard this patch.
src/Item.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
                 $included = $included->merge($item->getIncluded());
190 190
             } elseif ($relationship instanceof ManyRelationInterface) {
191 191
                 $relationship->getIncluded()->each(
192
-                    function (ItemInterface $item) use (&$included) {
192
+                    function(ItemInterface $item) use (&$included) {
193 193
                         if ($item->canBeIncluded()) {
194 194
                             $included->push($item->toJsonApiArray());
195 195
                         }
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 
202 202
         return $included
203 203
             ->unique(
204
-                function (array $item) {
204
+                function(array $item) {
205 205
                     return $item['type'].':'.$item['id'];
206 206
                 }
207 207
             )
Please login to merge, or discard this patch.