Code Duplication    Length = 7-7 lines in 5 locations

Validator/Constraints/CNPJValidator.php 3 locations

@@ 46-52 (lines=7) @@
43
        $d1 = $d1 < 2
44
            ? 0
45
            : 11 - $d1;
46
        if ($valueNumber{12} != $d1) {
47
            $this->context->buildViolation($constraint->message)
48
                ->setParameter('{{ value }}', $this->formatValue($value))
49
                ->addViolation();
50
51
            return;
52
        }
53
        for ($i = 0, $aux = 6, $count = 0; $i < 13; ++$i) {
54
            $count += $valueNumber{$i}
55
            * $aux;
@@ 64-70 (lines=7) @@
61
        $d2 = $d2 < 2
62
            ? 0
63
            : 11 - $d2;
64
        if ($valueNumber{13} != $d2) {
65
            $this->context->buildViolation($constraint->message)
66
                ->setParameter('{{ value }}', $this->formatValue($value))
67
                ->addViolation();
68
69
            return;
70
        }
71
    }
72
}
73
@@ 28-34 (lines=7) @@
25
            return;
26
        }
27
        $valueNumber = preg_replace('/[^0-9]/', '', $value);
28
        if (strlen($valueNumber) != 14) {
29
            $this->context->buildViolation($constraint->message)
30
                ->setParameter('{{ value }}', $this->formatValue($value))
31
                ->addViolation();
32
33
            return;
34
        }
35
        for ($i = 0, $aux = 5, $count = 0; $i < 12; ++$i) {
36
            $count += $valueNumber{$i}
37
            * $aux;

Validator/Constraints/CPFValidator.php 2 locations

@@ 28-34 (lines=7) @@
25
            return;
26
        }
27
        $valueNumber = preg_replace('/[^0-9]/', '', $value);
28
        if (strlen($valueNumber) != 11) {
29
            $this->context->buildViolation($constraint->message)
30
                ->setParameter('{{ value }}', $this->formatValue($value))
31
                ->addViolation();
32
33
            return;
34
        }
35
        if (!preg_match('/(?!(\d)\1{10})\d{11}/', $valueNumber)) {
36
            $this->context->buildViolation($constraint->message)
37
                ->setParameter('{{ value }}', $this->formatValue($value))
@@ 35-41 (lines=7) @@
32
33
            return;
34
        }
35
        if (!preg_match('/(?!(\d)\1{10})\d{11}/', $valueNumber)) {
36
            $this->context->buildViolation($constraint->message)
37
                ->setParameter('{{ value }}', $this->formatValue($value))
38
                ->addViolation();
39
40
            return;
41
        }
42
        for ($t = 9; $t < 11; ++$t) {
43
            for ($d = 0, $c = 0; $c < $t; ++$c) {
44
                $d += $valueNumber{$c}