Code Duplication    Length = 6-8 lines in 3 locations

src/Validation/Validator.php 3 locations

@@ 323-328 (lines=6) @@
320
                foreach ($attributes as $name => $value) {
321
                    if ($this->hasAttributeIndex($name) === true) {
322
                        $this->executeBlock($value, $this->getAttributeIndex($name));
323
                    } elseif ($this->isIgnoreUnknowns() === false) {
324
                        $title   = $this->formatMessage(ErrorCodes::INVALID_VALUE);
325
                        $details = $this->formatMessage(ErrorCodes::UNKNOWN_ATTRIBUTE);
326
                        $status  = $this->getErrorStatus();
327
                        $this->getJsonApiErrorCollection()->addDataAttributeError($name, $title, $details, $status);
328
                    }
329
                }
330
            }
331
        }
@@ 383-389 (lines=7) @@
380
                    } elseif (array_key_exists($name, $toManyIndexes) === true) {
381
                        // it might be toMany relationship
382
                        $this->validateAsToManyRelationship($toManyIndexes[$name], $name, $relationship);
383
                    } else {
384
                        // unknown relationship
385
                        $title   = $this->formatMessage(ErrorCodes::INVALID_VALUE);
386
                        $details = $this->formatMessage(ErrorCodes::UNKNOWN_RELATIONSHIP);
387
                        $status  = $this->getErrorStatus();
388
                        $this->getJsonApiErrorCollection()->addRelationshipError($name, $title, $details, $status);
389
                    }
390
                }
391
            }
392
        }
@@ 465-472 (lines=8) @@
462
            $isParsed = false;
463
        }
464
465
        if ($isParsed === true) {
466
            // All right we got something. Now pass it to a validation rule.
467
            $this->executeBlock($collectedPairs, $index);
468
        } else {
469
            $title   = $this->formatMessage(ErrorCodes::INVALID_VALUE);
470
            $details = $this->formatMessage(ErrorCodes::INVALID_RELATIONSHIP);
471
            $this->getJsonApiErrorCollection()->addRelationshipError($name, $title, $details, $this->getErrorStatus());
472
        }
473
    }
474
475
    /**