Code Duplication    Length = 3-3 lines in 2 locations

src/mrcnpdlk/Validator/Types/Nip.php 1 location

@@ 37-39 (lines=3) @@
34
            $countWeights = count($weights);
35
            $checkSum     = 0;
36
37
            for ($i = 0; $i < $countWeights; $i++) {
38
                $checkSum += $weights[$i] * intval($checkedValue[$i]);
39
            }
40
            $checkSum = $checkSum % 11;
41
            /**
42
             * http://zylla.wipos.p.lodz.pl/ut/nip-rego.html

src/mrcnpdlk/Validator/Types/Regon.php 1 location

@@ 35-37 (lines=3) @@
32
                }
33
                $sum          = 0;
34
                $countWeights = count($weights);
35
                for ($i = 0; $i < $countWeights; $i++) {
36
                    $sum += $weights[$i] * intval($checkedValue[$i]);
37
                }
38
                $checksum = ($sum % 11) % 10;
39
40
                if ($checksum !== intval($checkedValue[$countWeights])) {