Code Duplication    Length = 8-8 lines in 2 locations

src/Validation/Validator.php 2 locations

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