Passed
Pull Request — master (#2)
by Alberto
05:02 queued 02:02
created
src/Serialization/JsonApiDeserializer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
         if (true === array_key_exists(self::REFERENCE_KEYS_ID, $reference)) {
110 110
             $keys['_' . self::REFERENCE_KEYS_ID] = is_numeric($reference[self::REFERENCE_KEYS_ID])
111
-                ? (int) $reference[self::REFERENCE_KEYS_ID]
111
+                ? (int)$reference[self::REFERENCE_KEYS_ID]
112 112
                 : $reference[self::REFERENCE_KEYS_ID];
113 113
         }
114 114
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
             $root = &$relationships[array_shift($pathParts)] ?? [];
187 187
             while (count($pathParts) >= 1) {
188 188
                 $currentPath = array_shift($pathParts);
189
-                $root = &$root[is_numeric($currentPath) ? (int) $currentPath : $currentPath] ?? [];
189
+                $root = &$root[is_numeric($currentPath) ? (int)$currentPath : $currentPath] ?? [];
190 190
             }
191 191
 
192 192
             $root = array_merge_recursive(
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
         unset($relationship[self::REFERENCE_ATTRIBUTES], $relationship[self::REFERENCE_RELATIONSHIPS]);
230 230
 
231 231
         $relationships = array_map(
232
-            function ($key, $item) {
232
+            function($key, $item) {
233 233
                 return $this->parseRelationship($key, $item[self::REFERENCE_DATA] ?? $item);
234 234
             },
235 235
             array_keys($relationships),
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 
267 267
         $recursiveRelationships = array_filter(
268 268
             $relationship,
269
-            static function ($item, $key) {
269
+            static function($item, $key) {
270 270
                 return true === is_int($key) || (true === is_array($item) && true === array_key_exists(self::REFERENCE_DATA, $item));
271 271
             },
272 272
             ARRAY_FILTER_USE_BOTH
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
             $key => array_merge(
278 278
                 $this->completeRelationship($normalRelationships) ?? [],
279 279
                 ...array_map(
280
-                    function ($subKey, $item) {
280
+                    function($subKey, $item) {
281 281
                         if (false === is_int($subKey)) {
282 282
                             return $this->parseRelationship($subKey, $item[self::REFERENCE_DATA], true);
283 283
                         }
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
             }
308 308
 
309 309
             return array_map(
310
-                function ($element) {
310
+                function($element) {
311 311
                     return $this->parseData($element);
312 312
                 },
313 313
                 $data
Please login to merge, or discard this patch.
src/Serialization/JsonApiSerializer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
         }
161 161
 
162 162
         if (true === array_key_exists(self::REFERENCE_KEYS_ID, $reference)) {
163
-            $keys[trim(self::REFERENCE_KEYS_ID, '_')] = (string) $reference[self::REFERENCE_KEYS_ID];
163
+            $keys[trim(self::REFERENCE_KEYS_ID, '_')] = (string)$reference[self::REFERENCE_KEYS_ID];
164 164
         }
165 165
 
166 166
         return $keys;
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
         $attributes = self::filterKeyOrAttributes($reference, true);
249 249
         $relationships = array_filter(
250 250
             $reference,
251
-            static function ($item, $key) {
251
+            static function($item, $key) {
252 252
                 if (true === is_int($key)) {
253 253
                     return false;
254 254
                 }
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
             $parsedReference = $this->parseReference($elements);
294 294
             if (null === $parsedReference) {
295 295
                 return array_map(
296
-                    function ($element) {
296
+                    function($element) {
297 297
                         return $this->processRecursiveElement($element);
298 298
                     },
299 299
                     $elements
Please login to merge, or discard this patch.