Code Duplication    Length = 5-8 lines in 2 locations

src/date/GregorianCalendar.class.php 2 locations

@@ 504-511 (lines=8) @@
501
        if ($this->fInvertGregorian) {
502
            $this->fIsGregorian = !$this->fIsGregorian;
503
        }
504
        if ($this->fIsGregorian) {
505
            $isLeap = $isLeap && (($eyear % 100 != 0) || ($eyear % 400 == 0));
506
            // Add 2 because Gregorian calendar starts 2 days after
507
            // Julian calendar
508
            $gregShift = CalendarGrego::gregorianShift($eyear);
509
510
            $julianDay += $gregShift;
511
        }
512
513
        // At this point julianDay indicates the day BEFORE the first
514
        // day of January 1, <eyear> of either the Julian or Gregorian
@@ 847-851 (lines=5) @@
844
        $y = $year - 1;
845
        $julianDay = 365.0 * $y + floor($y / 4) + (DateDefinitions::JAN_1_1_JULIAN_DAY - 3);
846
847
        if ($isGregorian) {
848
            $isLeap = $isLeap && (($year % 100 != 0) || ($year % 400 == 0));
849
            // Add 2 because Gregorian calendar starts 2 days after Julian calendar
850
            $julianDay += CalendarGrego::gregorianShift($year);
851
        }
852
853
        return $julianDay;
854
    }