Code Duplication    Length = 7-10 lines in 2 locations

src/PhpSpreadsheet/Calculation/DateTime.php 2 locations

@@ 690-696 (lines=7) @@
687
            case 'D':
688
                $retVal = intval($difference);
689
                break;
690
            case 'M':
691
                $retVal = intval($endMonths - $startMonths) + (intval($endYears - $startYears) * 12);
692
                //    We're only interested in full months
693
                if ($endDays < $startDays) {
694
                    --$retVal;
695
                }
696
                break;
697
            case 'Y':
698
                $retVal = intval($endYears - $startYears);
699
                //    We're only interested in full months
@@ 719-728 (lines=10) @@
716
                    $retVal = $endDays - $startDays;
717
                }
718
                break;
719
            case 'YM':
720
                $retVal = intval($endMonths - $startMonths);
721
                if ($retVal < 0) {
722
                    $retVal += 12;
723
                }
724
                //    We're only interested in full months
725
                if ($endDays < $startDays) {
726
                    --$retVal;
727
                }
728
                break;
729
            case 'YD':
730
                $retVal = intval($difference);
731
                if ($endYears > $startYears) {