Code Duplication    Length = 14-14 lines in 2 locations

src/Constraints/IpValidator.php 1 location

@@ 12-25 (lines=14) @@
9
/**
10
 * @author Sullivan Senechal <[email protected]>
11
 */
12
final class IpValidator extends AbstractIsoCodesConstraintValidator
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public function validate($value, Constraint $constraint)
18
    {
19
        parent::validate($value, $constraint);
20
21
        if ($value && !IsoCodes\IP::validate($value) && !IsoCodes\IP::validateIPV6($value)) {
22
            $this->createViolation($constraint->message);
23
        }
24
    }
25
}
26

src/Constraints/IsbnValidator.php 1 location

@@ 12-25 (lines=14) @@
9
/**
10
 * @author Sullivan Senechal <[email protected]>
11
 */
12
final class IsbnValidator extends AbstractIsoCodesConstraintValidator
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public function validate($value, Constraint $constraint)
18
    {
19
        parent::validate($value, $constraint);
20
21
        if ($value && !IsoCodes\Isbn::validate($value, $constraint->type)) {
22
            $this->createViolation($constraint->message);
23
        }
24
    }
25
}
26