Code Duplication    Length = 8-8 lines in 2 locations

src/Validation/Validator.php 2 locations

@@ 248-255 (lines=8) @@
245
        $ends = JsonApiRuleSerializer::getRuleEndIndexes($this->getTypeRule());
246
        $this->executeEnds($ends);
247
248
        if (count($this->getErrors()) > 0) {
249
            $title = $this->formatMessage(ErrorCodes::INVALID_VALUE);
250
            foreach ($this->getErrors()->get() as $error) {
251
                $this->getJsonApiErrorCollection()
252
                    ->addDataTypeError($title, $this->getMessage($error), $this->getErrorStatus());
253
            }
254
            $this->getErrors()->clear();
255
        }
256
257
        return $this;
258
    }
@@ 285-292 (lines=8) @@
282
        $ends = JsonApiRuleSerializer::getRuleEndIndexes($this->getIdRule());
283
        $this->executeEnds($ends);
284
285
        if (count($this->getErrors()) > 0) {
286
            $title = $this->formatMessage(ErrorCodes::INVALID_VALUE);
287
            foreach ($this->getErrors()->get() as $error) {
288
                $this->getJsonApiErrorCollection()
289
                    ->addDataIdError($title, $this->getMessage($error), $this->getErrorStatus());
290
            }
291
            $this->getErrors()->clear();
292
        }
293
294
        return $this;
295
    }