Code Duplication    Length = 13-21 lines in 3 locations

src/CalendarSettings/Jalali.php 3 locations

@@ 65-79 (lines=15) @@
62
63
        $year = $year - 622;
64
65
        if ($temp_day % 30 == 0) {
66
            $month = ( $temp_day / 30 ) + 9;
67
68
            $day = 30;
69
        } else {
70
            $month = ( $temp_day / 30 ) + 10;
71
72
            $day = $temp_day % 30;
73
        }
74
    } else {
75
        $year = $year - 621;
76
77
        $temp_day = $temp_day - 79;
78
79
        if ($temp_day <= 186) {
80
            if ($temp_day % 31 == 0) {
81
                $month = ( $temp_day / 31 );
82
@@ 80-92 (lines=13) @@
77
        $temp_day = $temp_day - 79;
78
79
        if ($temp_day <= 186) {
80
            if ($temp_day % 31 == 0) {
81
                $month = ( $temp_day / 31 );
82
83
                $day = 31;
84
            } else {
85
                $month = ( $temp_day / 31 ) + 1;
86
87
                $day = ( $temp_day % 31 );
88
            }
89
        } else {
90
            $temp_day = $temp_day - 186;
91
92
            if ($temp_day % 30 == 0) {
93
                $month = ( $temp_day / 30 ) + 6;
94
95
                $day = 30;
@@ 89-109 (lines=21) @@
86
87
                $day = ( $temp_day % 31 );
88
            }
89
        } else {
90
            $temp_day = $temp_day - 186;
91
92
            if ($temp_day % 30 == 0) {
93
                $month = ( $temp_day / 30 ) + 6;
94
95
                $day = 30;
96
            } else {
97
                $month = ( $temp_day / 30 ) + 7;
98
99
                $day = $temp_day % 30;
100
            }
101
        }
102
    }
103
104
         $date_time->setDate($year, $month, $day);
105
106
         return $date_time;
107
108
  },
109
110
  /************************************************************
111
   *                        Convert From
112
   ************************************************************