Code Duplication    Length = 9-9 lines in 2 locations

Salariu/InputValidation.php 1 location

@@ 95-103 (lines=9) @@
92
        $lngDate    = $tCSG->get('ym');
93
        $intValue   = 0;
94
        $maxCounter = count($inMny['EMW']);
95
        for ($counter = 0; $counter < $maxCounter; $counter++) {
96
            $crtVal         = $inMny['EMW'][$counter];
97
            $crtDV          = \DateTime::createFromFormat('Y-n-j', $crtVal['Year'] . '-' . $crtVal['Month'] . '-1');
98
            $crtDateOfValue = (int) $crtDV->format('Ymd');
99
            if (($lngDate <= $inMny['YM range']['maximumInt']) && ($lngDate >= $crtDateOfValue)) {
100
                $intValue = $crtVal['Value'];
101
                $counter  = $maxCounter;
102
            }
103
        }
104
        return $intValue;
105
    }
106

Salariu/Taxation.php 1 location

@@ 46-54 (lines=9) @@
43
    private function determineUnemploymentTax($yearMonth, $inMny, $dtR) {
44
        $intValue   = 0;
45
        $maxCounter = count($inMny);
46
        for ($counter = 0; $counter < $maxCounter; $counter++) {
47
            $crtVal         = $inMny[$counter];
48
            $crtDV          = \DateTime::createFromFormat('Y-n-j', $crtVal['Year'] . '-' . $crtVal['Month'] . '-01');
49
            $crtDateOfValue = (int) $crtDV->format('Ymd');
50
            if (($yearMonth <= $dtR['maximumInt']) && ($yearMonth >= $crtDateOfValue)) {
51
                $intValue = $crtVal['Percentage'];
52
                $counter  = $maxCounter;
53
            }
54
        }
55
        return $intValue;
56
    }
57