Code Duplication    Length = 6-8 lines in 3 locations

src/PhpSpreadsheet/Calculation/DateTime.php 3 locations

@@ 1086-1091 (lines=6) @@
1083
            }
1084
            foreach ($holidayDates as $holidayDate) {
1085
                if ($decrementing) {
1086
                    if (($holidayDate <= $startDate) && ($holidayDate >= $endDate)) {
1087
                        if (!in_array($holidayDate, $holidayCountedArray)) {
1088
                            --$endDate;
1089
                            $holidayCountedArray[] = $holidayDate;
1090
                        }
1091
                    }
1092
                } else {
1093
                    if (($holidayDate >= $startDate) && ($holidayDate <= $endDate)) {
1094
                        if (!in_array($holidayDate, $holidayCountedArray)) {
@@ 1092-1099 (lines=8) @@
1089
                            $holidayCountedArray[] = $holidayDate;
1090
                        }
1091
                    }
1092
                } else {
1093
                    if (($holidayDate >= $startDate) && ($holidayDate <= $endDate)) {
1094
                        if (!in_array($holidayDate, $holidayCountedArray)) {
1095
                            ++$endDate;
1096
                            $holidayCountedArray[] = $holidayDate;
1097
                        }
1098
                    }
1099
                }
1100
                //    Adjust the calculated end date if it falls over a weekend
1101
                $endDoW = self::WEEKDAY($endDate, 3);
1102
                if ($endDoW >= 5) {
@@ 992-997 (lines=6) @@
989
            if (is_string($holidayDate = self::getDateValue($holidayDate))) {
990
                return Functions::VALUE();
991
            }
992
            if (($holidayDate >= $startDate) && ($holidayDate <= $endDate)) {
993
                if ((self::WEEKDAY($holidayDate, 2) < 6) && (!in_array($holidayDate, $holidayCountedArray))) {
994
                    --$partWeekDays;
995
                    $holidayCountedArray[] = $holidayDate;
996
                }
997
            }
998
        }
999
1000
        if ($sDate > $eDate) {