Passed
Pull Request — master (#25)
by Bjorn
07:50
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/Providers/ServiceProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
     {
47 47
         $this->app->singleton(
48 48
             TypeMapperInterface::class,
49
-            function () {
49
+            function() {
50 50
                 return new TypeMapper();
51 51
             }
52 52
         );
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     {
57 57
         $this->app->bind(
58 58
             ParserInterface::class,
59
-            function (Application $app) {
59
+            function(Application $app) {
60 60
                 return new Parser(
61 61
                     new JsonApiClientManger(),
62 62
                     new Hydrator($app->make(TypeMapperInterface::class)),
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     {
71 71
         $this->app->bind(
72 72
             ApiClientInterface::class,
73
-            function () {
73
+            function() {
74 74
                 return new ApiClient(
75 75
                     $this->getHttpClient(),
76 76
                     config('jsonapi.base_uri'),
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
         $this->app->bind(
83 83
             ApiDocumentClientInterface::class,
84
-            function (Application $app) {
84
+            function(Application $app) {
85 85
                 return new ApiDocumentClient(
86 86
                     $app->make(ApiClientInterface::class),
87 87
                     new ItemDocumentSerializer(),
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/Item.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
                 $included = $included->merge($includedFromRelationship->getIncluded());
201 201
             } elseif ($includedFromRelationship instanceof Collection) {
202 202
                 $includedFromRelationship->each(
203
-                    function (ItemInterface $item) use (&$included) {
203
+                    function(ItemInterface $item) use (&$included) {
204 204
                         if (!empty($item->getType()) && null !== $item->getId()) {
205 205
                             $included->push($item->toJsonApiArray());
206 206
                         }
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
         }
214 214
 
215 215
         return $included->unique(
216
-            function (array $item) {
216
+            function(array $item) {
217 217
                 return $item['type'].':'.$item['id'];
218 218
             }
219 219
         );
Please login to merge, or discard this patch.