Code Duplication    Length = 4-4 lines in 2 locations

src/Cnpj.php 2 locations

@@ 22-25 (lines=4) @@
19
        }
20
        $cnpj = str_pad($cnpj, 14, '0', STR_PAD_LEFT);
21
        // Valida primeiro dígito verificador
22
        for ($i = 0, $j = 5, $soma = 0; $i < 12; $i ++) {
23
            $soma += $cnpj{$i} * $j;
24
            $j = ($j == 2) ? 9 : $j - 1;
25
        }
26
        $resto = $soma % 11;
27
        if ($cnpj{12} != ($resto < 2 ? 0 : 11 - $resto)) {
28
            return false;
@@ 31-34 (lines=4) @@
28
            return false;
29
        }
30
        // Valida segundo dígito verificador
31
        for ($i = 0, $j = 6, $soma = 0; $i < 13; $i ++) {
32
            $soma += $cnpj{$i} * $j;
33
            $j = ($j == 2) ? 9 : $j - 1;
34
        }
35
        $resto = $soma % 11;
36
        return $cnpj{13} == ($resto < 2 ? 0 : 11 - $resto);
37
    }