Code Duplication    Length = 21-25 lines in 2 locations

src/CalendarSettings/Ghamari.php 1 location

@@ 259-279 (lines=21) @@
256
257
     },
258
259
     'day_of_week' => function( $date_time ) {
260
261
       $configGhamari = include(   'Ghamari.php' );
262
263
       $configGregorian = include( 'Gregorian.php' );
264
265
       $day = $date_time->format('l');
266
267
       $day = str_replace( $configGregorian['days_of_week'], $configGhamari['days_of_week'], $day);
268
269
       foreach ( $configGhamari['days_of_week'] as $key => $value ) {
270
271
         if( $value == $day ) {
272
273
           return $key += 1;
274
275
         }
276
277
       }
278
279
     },
280
281
     /************************************************************
282
      *                       Leap year

src/CalendarSettings/Shamsi.php 1 location

@@ 138-162 (lines=25) @@
135
136
  },
137
138
  'day_of_week' => function( $date_time ) {
139
140
        $configShamsi = include(  'Shamsi.php' );
141
142
        $configGregorian = include( 'Gregorian.php' );
143
144
        $day = $date_time->format('l');
145
146
        $day = str_replace( $configGregorian['days_of_week'], $configShamsi['days_of_week'], $day );
147
148
        foreach ( $configShamsi['days_of_week'] as $key => $value ) {
149
150
          if( $value == $day ) {
151
152
            if( $key <= 5 ) {
153
154
              return $key += 1;
155
156
            }
157
158
          }
159
160
        }
161
162
  },
163
164
  /************************************************************
165
   *                       Leap year