Code Duplication    Length = 6-8 lines in 3 locations

src/Validation/Validator.php 3 locations

@@ 328-333 (lines=6) @@
325
                foreach ($attributes as $name => $value) {
326
                    if ($this->hasAttributeIndex($name) === true) {
327
                        $this->executeBlock($value, $this->getAttributeIndex($name));
328
                    } elseif ($this->isIgnoreUnknowns() === false) {
329
                        $title   = $this->formatMessage(ErrorCodes::INVALID_VALUE);
330
                        $details = $this->formatMessage(ErrorCodes::UNKNOWN_ATTRIBUTE);
331
                        $status  = $this->getErrorStatus();
332
                        $this->getJsonApiErrorCollection()->addDataAttributeError($name, $title, $details, $status);
333
                    }
334
                }
335
            }
336
        }
@@ 388-394 (lines=7) @@
385
                    } elseif (array_key_exists($name, $toManyIndexes) === true) {
386
                        // it might be toMany relationship
387
                        $this->validateAsToManyRelationship($toManyIndexes[$name], $name, $relationship);
388
                    } else {
389
                        // unknown relationship
390
                        $title   = $this->formatMessage(ErrorCodes::INVALID_VALUE);
391
                        $details = $this->formatMessage(ErrorCodes::UNKNOWN_RELATIONSHIP);
392
                        $status  = $this->getErrorStatus();
393
                        $this->getJsonApiErrorCollection()->addRelationshipError($name, $title, $details, $status);
394
                    }
395
                }
396
            }
397
        }
@@ 470-477 (lines=8) @@
467
            $isParsed = false;
468
        }
469
470
        if ($isParsed === true) {
471
            // All right we got something. Now pass it to a validation rule.
472
            $this->executeBlock($collectedPairs, $index);
473
        } else {
474
            $title   = $this->formatMessage(ErrorCodes::INVALID_VALUE);
475
            $details = $this->formatMessage(ErrorCodes::INVALID_RELATIONSHIP);
476
            $this->getJsonApiErrorCollection()->addRelationshipError($name, $title, $details, $this->getErrorStatus());
477
        }
478
    }
479
480
    /**