Code Duplication    Length = 4-4 lines in 2 locations

src/Cnpj.php 2 locations

@@ 32-35 (lines=4) @@
29
        }
30
        $cnpj = str_pad($cnpj, 14, '0', STR_PAD_LEFT);
31
        // Valida primeiro dígito verificador
32
        for ($i = 0, $j = 5, $soma = 0; $i < 12; $i ++) {
33
            $soma += $cnpj{$i} * $j;
34
            $j = ($j == 2) ? 9 : $j - 1;
35
        }
36
        $resto = $soma % 11;
37
        if ($cnpj{12} != ($resto < 2 ? 0 : 11 - $resto)) {
38
            return false;
@@ 41-44 (lines=4) @@
38
            return false;
39
        }
40
        // Valida segundo dígito verificador
41
        for ($i = 0, $j = 6, $soma = 0; $i < 13; $i ++) {
42
            $soma += $cnpj{$i} * $j;
43
            $j = ($j == 2) ? 9 : $j - 1;
44
        }
45
        $resto = $soma % 11;
46
        return $cnpj{13} == ($resto < 2 ? 0 : 11 - $resto);
47
    }