Completed
Pull Request — master (#55)
by Jasper
03:04
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/Links.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@
 block discarded – undo
112 112
     public function toArray()
113 113
     {
114 114
         return array_map(
115
-            function (Link $link) {
115
+            function(Link $link) {
116 116
                 return $link->toArray();
117 117
             },
118 118
             $this->links
Please login to merge, or discard this patch.
src/DocumentFactory.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -34,12 +34,12 @@  discard block
 block discarded – undo
34 34
     {
35 35
         return Collection::wrap($data)
36 36
             ->flatMap(
37
-                function (ItemInterface $item) {
37
+                function(ItemInterface $item) {
38 38
                     return $this->getIncludedFromItem($item);
39 39
                 }
40 40
             )
41 41
             ->unique(
42
-                static function (ItemInterface $item) {
42
+                static function(ItemInterface $item) {
43 43
                     return sprintf('%s:%s', $item->getType(), $item->getId());
44 44
                 }
45 45
             )
@@ -55,24 +55,24 @@  discard block
 block discarded – undo
55 55
     {
56 56
         return Collection::make($item->getRelations())
57 57
             ->reject(
58
-                static function ($relationship) {
58
+                static function($relationship) {
59 59
                     /* @var \Swis\JsonApi\Client\Interfaces\OneRelationInterface|\Swis\JsonApi\Client\Interfaces\ManyRelationInterface $relationship */
60 60
                     return $relationship->shouldOmitIncluded() || !$relationship->hasIncluded();
61 61
                 }
62 62
             )
63 63
             ->flatMap(
64
-                static function ($relationship) {
64
+                static function($relationship) {
65 65
                     /* @var \Swis\JsonApi\Client\Interfaces\OneRelationInterface|\Swis\JsonApi\Client\Interfaces\ManyRelationInterface $relationship */
66 66
                     return Collection::wrap($relationship->getIncluded());
67 67
                 }
68 68
             )
69 69
             ->flatMap(
70
-                function (ItemInterface $item) {
70
+                function(ItemInterface $item) {
71 71
                     return Collection::wrap($item)->merge($this->getIncludedFromItem($item));
72 72
                 }
73 73
             )
74 74
             ->filter(
75
-                function (ItemInterface $item) {
75
+                function(ItemInterface $item) {
76 76
                     return $this->itemCanBeIncluded($item);
77 77
                 }
78 78
             );
Please login to merge, or discard this patch.
src/Providers/ServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
     {
55 55
         $this->app->bind(
56 56
             ClientInterface::class,
57
-            function () {
57
+            function() {
58 58
                 return new Client(
59 59
                     $this->getHttpClient(),
60 60
                     config('jsonapi.base_uri'),
Please login to merge, or discard this patch.
src/Parsers/DocumentParser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -143,13 +143,13 @@
 block discarded – undo
143 143
     {
144 144
         // N.B. We reverse the items to make sure the first item in the collection takes precedence
145 145
         $keyedItems = $items->reverse()->keyBy(
146
-            function (ItemInterface $item) {
146
+            function(ItemInterface $item) {
147 147
                 return $this->getItemKey($item);
148 148
             }
149 149
         );
150 150
 
151 151
         $items->each(
152
-            function (ItemInterface $item) use ($keyedItems) {
152
+            function(ItemInterface $item) use ($keyedItems) {
153 153
                 foreach ($item->getRelations() as $name => $relation) {
154 154
                     if ($relation instanceof OneRelationInterface) {
155 155
                         /** @var \Swis\JsonApi\Client\Interfaces\ItemInterface $relatedItem */
Please login to merge, or discard this patch.
src/Parsers/ItemParser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@
 block discarded – undo
134 134
         if ($data instanceof ResourceIdentifierCollectionInterface) {
135 135
             return Collection::make($data->asArray())
136 136
                 ->map(
137
-                    function (ResourceIdentifierInterface $identifier) {
137
+                    function(ResourceIdentifierInterface $identifier) {
138 138
                         return $this->getItemInstance($identifier->get('type'))
139 139
                             ->setId($identifier->get('id'));
140 140
                     }
Please login to merge, or discard this patch.
src/Parsers/LinksParser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
     {
19 19
         return new Links(
20 20
             array_map(
21
-                function ($link) {
21
+                function($link) {
22 22
                     return $this->buildLink($link);
23 23
                 },
24 24
                 $links
Please login to merge, or discard this patch.
src/Parsers/CollectionParser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@
 block discarded – undo
33 33
     {
34 34
         return Collection::make($jsonApiCollection->asArray())
35 35
             ->map(
36
-                function (ResourceItemInterface $item) {
36
+                function(ResourceItemInterface $item) {
37 37
                     return $this->itemParser->parse($item);
38 38
                 }
39 39
             );
Please login to merge, or discard this patch.