Code Duplication    Length = 10-10 lines in 2 locations

src/Mapping/Validation/Constraint/ExistingParameterValidator.php 1 location

@@ 17-26 (lines=10) @@
14
     * @inheritDoc
15
     * @param ExistingParameter $constraint
16
     */
17
    public function validate($value, Constraint $constraint)
18
    {
19
        if (!Registry::getInstance()->find($value)) {
20
            $this
21
                ->context
22
                ->buildViolation($constraint->message)
23
                ->setParameter('{{ name }}', $value)
24
                ->addViolation();
25
        }
26
    }
27
}
28

src/Mapping/Validation/Constraint/ExistingTypeValidator.php 1 location

@@ 17-26 (lines=10) @@
14
     * @inheritDoc
15
     * @param ExistingType $constraint
16
     */
17
    public function validate($value, Constraint $constraint)
18
    {
19
        if (!Registry::getInstance()->find($value)) {
20
            $this
21
                ->context
22
                ->buildViolation($constraint->message)
23
                ->setParameter('{{ name }}', $value)
24
                ->addViolation();
25
        }
26
    }
27
28
}
29