Completed
Branch master (ffe81d)
by Neomerx
04:33
created
src/Encoder/Parameters/ParametersAnalyzer.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         foreach ($includePaths as $curPath) {
107 107
             if ($pathLength === 0) {
108 108
                 $relationshipName = $this->getRelationshipNameForTopResource($curPath);
109
-            } elseif (strpos($curPath, $pathBeginning . DocumentInterface::PATH_SEPARATOR) === 0) {
109
+            } elseif (strpos($curPath, $pathBeginning.DocumentInterface::PATH_SEPARATOR) === 0) {
110 110
                 $relationshipName = $this->getRelationshipNameForResource($curPath, $pathLength);
111 111
             } else {
112 112
                 $relationshipName = null;
@@ -205,8 +205,7 @@  discard block
 block discarded – undo
205 205
     {
206 206
         $nextSeparatorPos = strpos($curPath, DocumentInterface::PATH_SEPARATOR, $pathLength + 1);
207 207
         $relationshipName = $nextSeparatorPos === false ?
208
-            substr($curPath, $pathLength + 1) :
209
-            substr($curPath, $pathLength + 1, $nextSeparatorPos - $pathLength - 1);
208
+            substr($curPath, $pathLength + 1) : substr($curPath, $pathLength + 1, $nextSeparatorPos - $pathLength - 1);
210 209
 
211 210
         return $relationshipName;
212 211
     }
Please login to merge, or discard this patch.
src/Encoder/Parser/Parser.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -243,8 +243,7 @@
 block discarded – undo
243 243
     {
244 244
         ($data === null || (is_array($data) === true && empty($data) === true)) ?: Exceptions::throwLogicException();
245 245
 
246
-        $replyType = ($data === null ? ParserReplyInterface::REPLY_TYPE_NULL_RESOURCE_STARTED :
247
-            ParserReplyInterface::REPLY_TYPE_EMPTY_RESOURCE_STARTED);
246
+        $replyType = ($data === null ? ParserReplyInterface::REPLY_TYPE_NULL_RESOURCE_STARTED : ParserReplyInterface::REPLY_TYPE_EMPTY_RESOURCE_STARTED);
248 247
 
249 248
         return $this->parserFactory->createEmptyReply($replyType, $this->stack);
250 249
     }
Please login to merge, or discard this patch.
src/Encoder/Stack/StackFrame.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@
 block discarded – undo
129 129
             $this->path = $this->relationship->getName();
130 130
         } else {
131 131
             $this->path =
132
-                $this->previous->getPath() . DocumentInterface::PATH_SEPARATOR . $this->relationship->getName();
132
+                $this->previous->getPath().DocumentInterface::PATH_SEPARATOR.$this->relationship->getName();
133 133
         }
134 134
     }
135 135
 }
Please login to merge, or discard this patch.
src/Document/Document.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
         $foundInData     = isset($this->bufferForData[$type][$idx]);
269 269
         $foundInIncluded = isset($this->bufferForIncluded[$type][$idx]);
270 270
 
271
-        $addMeta = function (array $representation, Closure $getMetaClosure) {
271
+        $addMeta = function(array $representation, Closure $getMetaClosure) {
272 272
             if (empty($representation[self::KEYWORD_RELATIONSHIPS]) === true) {
273 273
                 // if no relationships have been added remove empty placeholder
274 274
                 unset($representation[self::KEYWORD_RELATIONSHIPS]);
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
             $representation = $this->bufferForData[$type][$idx];
288 288
             unset($this->bufferForData[$type][$idx]);
289 289
 
290
-            $this->data[] = $addMeta($representation, function () use ($resource) {
290
+            $this->data[] = $addMeta($representation, function() use ($resource) {
291 291
                 return $resource->getRelationshipsPrimaryMeta();
292 292
             });
293 293
         }
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
             $representation = $this->bufferForIncluded[$type][$idx];
297 297
             unset($this->bufferForIncluded[$type][$idx]);
298 298
 
299
-            $this->included[] = $addMeta($representation, function () use ($resource) {
299
+            $this->included[] = $addMeta($representation, function() use ($resource) {
300 300
                 return $resource->getRelationshipsInclusionMeta();
301 301
             });
302 302
             // remember we added (type, id) at index
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
                 self::KEYWORD_JSON_API => $this->version,
316 316
                 self::KEYWORD_META     => $this->meta,
317 317
                 self::KEYWORD_ERRORS   => $this->errors,
318
-            ], function ($value) {
318
+            ], function($value) {
319 319
                 return $value !== null;
320 320
             });
321 321
         }
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
             self::KEYWORD_LINKS    => $this->links,
327 327
             self::KEYWORD_DATA     => true, // this field wont be filtered
328 328
             self::KEYWORD_INCLUDED => empty($this->included) === true ? null : array_values($this->included),
329
-        ], function ($value) {
329
+        ], function($value) {
330 330
             return $value !== null;
331 331
         });
332 332
 
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
             self::KEYWORD_ERRORS_DETAIL => $error->getDetail(),
375 375
             self::KEYWORD_ERRORS_SOURCE => $error->getSource(),
376 376
             self::KEYWORD_ERRORS_META   => $error->getMeta(),
377
-        ], function ($value) {
377
+        ], function($value) {
378 378
             return $value !== null;
379 379
         });
380 380
 
Please login to merge, or discard this patch.
src/Contracts/Encoder/EncoderInterface.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@
 block discarded – undo
132 132
     /**
133 133
      * Encode errors as JSON API string.
134 134
      *
135
-     * @param ErrorInterface[]|ErrorCollection $errors
135
+     * @param ErrorInterface[] $errors
136 136
      *
137 137
      * @return string
138 138
      */
Please login to merge, or discard this patch.
src/Contracts/Schema/SchemaFactoryInterface.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
      * @param SchemaInterface $schema
49 49
      * @param object          $resource
50 50
      * @param bool            $isInArray
51
-     * @param array<string,int>|null  $attributeKeysFilter
51
+     * @param array<string,int>|null  $fieldKeysFilter
52 52
      *
53 53
      * @return ResourceObjectInterface
54 54
      */
Please login to merge, or discard this patch.
src/Http/Query/BaseQueryParser.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
      * @param string|mixed $shouldBeString
130 130
      * @param string       $separator
131 131
      *
132
-     * @return iterable
132
+     * @return \Generator
133 133
      */
134 134
     protected function splitString(string $paramName, $shouldBeString, string $separator): iterable
135 135
     {
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
      * @param string|mixed $shouldBeString
148 148
      * @param string       $separator
149 149
      *
150
-     * @return iterable
150
+     * @return \Generator
151 151
      */
152 152
     protected function splitStringAndCheckNoEmpties(string $paramName, $shouldBeString, string $separator): iterable
153 153
     {
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
      * @param string       $paramName
166 166
      * @param string|mixed $shouldBeString
167 167
      *
168
-     * @return iterable
168
+     * @return \Generator
169 169
      */
170 170
     protected function splitCommaSeparatedStringAndCheckNoEmpties(string $paramName, $shouldBeString): iterable
171 171
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
     public function getIncludes(): iterable
67 67
     {
68 68
         if (array_key_exists(static::PARAM_INCLUDE, $this->getParameters()) === true) {
69
-            $splitByDot = function (string $path): iterable {
69
+            $splitByDot = function(string $path): iterable {
70 70
                 foreach ($this->splitStringAndCheckNoEmpties(static::PARAM_INCLUDE, $path, '.') as $link) {
71 71
                     yield $link;
72 72
                 }
Please login to merge, or discard this patch.
src/Schema/ResourceObject.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@
 block discarded – undo
122 122
      * @param SchemaInterface $schema
123 123
      * @param object          $resource
124 124
      * @param bool            $isInArray
125
-     * @param array<string,int>|null  $attributeKeysFilter
125
+     * @param array<string,int>|null  $fieldKeysFilter
126 126
      *
127 127
      * @SuppressWarnings(PHPMD.StaticAccess)
128 128
      */
Please login to merge, or discard this patch.
src/Exceptions/ErrorCollection.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
      */
120 120
     public function add(ErrorInterface $error): self
121 121
     {
122
-        $this->items[] =$error;
122
+        $this->items[] = $error;
123 123
 
124 124
         return $this;
125 125
     }
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
      */
423 423
     protected function getPathToData(): string
424 424
     {
425
-        return '/' . DocumentInterface::KEYWORD_DATA;
425
+        return '/'.DocumentInterface::KEYWORD_DATA;
426 426
     }
427 427
 
428 428
     /**
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
      */
431 431
     protected function getPathToType(): string
432 432
     {
433
-        return $this->getPathToData() . '/' . DocumentInterface::KEYWORD_TYPE;
433
+        return $this->getPathToData().'/'.DocumentInterface::KEYWORD_TYPE;
434 434
     }
435 435
 
436 436
     /**
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
      */
439 439
     protected function getPathToId(): string
440 440
     {
441
-        return $this->getPathToData() . '/' . DocumentInterface::KEYWORD_ID;
441
+        return $this->getPathToData().'/'.DocumentInterface::KEYWORD_ID;
442 442
     }
443 443
 
444 444
     /**
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
      */
447 447
     protected function getPathToAttributes(): string
448 448
     {
449
-        return $this->getPathToData() . '/' . DocumentInterface::KEYWORD_ATTRIBUTES;
449
+        return $this->getPathToData().'/'.DocumentInterface::KEYWORD_ATTRIBUTES;
450 450
     }
451 451
 
452 452
     /**
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
      */
457 457
     protected function getPathToAttribute(string $name): string
458 458
     {
459
-        return $this->getPathToData() . '/' . DocumentInterface::KEYWORD_ATTRIBUTES . '/' . $name;
459
+        return $this->getPathToData().'/'.DocumentInterface::KEYWORD_ATTRIBUTES.'/'.$name;
460 460
     }
461 461
 
462 462
     /**
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
      */
465 465
     protected function getPathToRelationships(): string
466 466
     {
467
-        return $this->getPathToData() . '/' . DocumentInterface::KEYWORD_RELATIONSHIPS;
467
+        return $this->getPathToData().'/'.DocumentInterface::KEYWORD_RELATIONSHIPS;
468 468
     }
469 469
 
470 470
     /**
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
      */
475 475
     protected function getPathToRelationship(string $name): string
476 476
     {
477
-        return $this->getPathToRelationships() . '/' . $name;
477
+        return $this->getPathToRelationships().'/'.$name;
478 478
     }
479 479
 
480 480
     /**
@@ -484,8 +484,8 @@  discard block
 block discarded – undo
484 484
      */
485 485
     protected function getPathToRelationshipType(string $name): string
486 486
     {
487
-        return $this->getPathToRelationship($name) . '/' .
488
-            DocumentInterface::KEYWORD_DATA . '/' . DocumentInterface::KEYWORD_TYPE;
487
+        return $this->getPathToRelationship($name).'/'.
488
+            DocumentInterface::KEYWORD_DATA.'/'.DocumentInterface::KEYWORD_TYPE;
489 489
     }
490 490
 
491 491
     /**
@@ -495,7 +495,7 @@  discard block
 block discarded – undo
495 495
      */
496 496
     protected function getPathToRelationshipId(string $name): string
497 497
     {
498
-        return $this->getPathToRelationship($name) . '/' .
499
-            DocumentInterface::KEYWORD_DATA . '/' . DocumentInterface::KEYWORD_ID;
498
+        return $this->getPathToRelationship($name).'/'.
499
+            DocumentInterface::KEYWORD_DATA.'/'.DocumentInterface::KEYWORD_ID;
500 500
     }
501 501
 }
Please login to merge, or discard this patch.