Code Duplication    Length = 6-8 lines in 2 locations

src/PhpSpreadsheet/Calculation/DateTime.php 2 locations

@@ 1064-1069 (lines=6) @@
1061
            }
1062
            foreach ($holidayDates as $holidayDate) {
1063
                if ($decrementing) {
1064
                    if (($holidayDate <= $startDate) && ($holidayDate >= $endDate)) {
1065
                        if (!in_array($holidayDate, $holidayCountedArray)) {
1066
                            --$endDate;
1067
                            $holidayCountedArray[] = $holidayDate;
1068
                        }
1069
                    }
1070
                } else {
1071
                    if (($holidayDate >= $startDate) && ($holidayDate <= $endDate)) {
1072
                        if (!in_array($holidayDate, $holidayCountedArray)) {
@@ 1070-1077 (lines=8) @@
1067
                            $holidayCountedArray[] = $holidayDate;
1068
                        }
1069
                    }
1070
                } else {
1071
                    if (($holidayDate >= $startDate) && ($holidayDate <= $endDate)) {
1072
                        if (!in_array($holidayDate, $holidayCountedArray)) {
1073
                            ++$endDate;
1074
                            $holidayCountedArray[] = $holidayDate;
1075
                        }
1076
                    }
1077
                }
1078
                //    Adjust the calculated end date if it falls over a weekend
1079
                $endDoW = self::DAYOFWEEK($endDate, 3);
1080
                if ($endDoW >= 5) {