Code Duplication    Length = 33-37 lines in 3 locations

src/CalendarSettings/Kurdish.php 1 location

@@ 184-220 (lines=37) @@
181
   *  example : Yekshanbe = result is 2
182
   *\_________________________________________________________/
183
  */
184
  'day_of_week' => function ($date_tim, $day_of_week) {
185
186
      $days_of_week = array(
187
          'Dúşeme',
188
          'Séşeme',
189
          'Çúwarşeme',
190
          'Péncşeme',
191
          'Heyní',
192
          'Şeme',
193
          'Yekşeme',
194
      );
195
196
      $days = array(
197
          1 => 'Şeme',
198
          2 => 'Yekşeme',
199
          3 => 'Dúşeme',
200
          4 => 'Séşeme',
201
          5 => 'Çúwarşeme',
202
          6 => 'Péncşeme',
203
          7 => 'Heyní'
204
      );
205
206
        $configGregorian = include 'Gregorian.php';
207
208
        $day = str_replace(
209
            $configGregorian[ 'days_of_week' ],
210
            $days_of_week,
211
            $day_of_week
212
        );
213
214
        foreach ($days as $key => $value) {
215
            if ($day == $value) {
216
               return $key;
217
            }
218
        }
219
220
  },
221
222
  /************************************************************
223
   *                       Leap year

src/CalendarSettings/Hijri.php 1 location

@@ 257-289 (lines=33) @@
254
      *  example : al-Aḥad = result is 1
255
      *\_________________________________________________________/
256
      */
257
     'day_of_week' => function ($date_time, $day_of_week) {
258
259
         $days_of_week = array(
260
            'al-Ithnayn',
261
            'ath-Thulatha\'',
262
            'al-Arbi\'a',
263
            'al-Khamees',
264
            'al-Jumu\'ah',
265
            'as-Sabt',
266
            'al-Aḥad',
267
         );
268
269
         $days = array(
270
            1 => 'al-Aḥad',
271
            2 => 'al-Ithnayn',
272
            3 => 'ath-Thulatha\'',
273
            4 => 'al-Arbi\'a',
274
            5 => 'al-Khamees',
275
            6 => 'al-Jumu\'ah',
276
            7 => 'as-Sabt',
277
         );
278
279
        $configGregorian = include 'Gregorian.php';
280
281
        $day = str_replace($configGregorian['days_of_week'], $days_of_week, $day_of_week);
282
283
        foreach ($days as $key => $value) {
284
            if ($value == $day) {
285
                return $key;
286
            }
287
        }
288
289
     },
290
291
     /************************************************************
292
      *                       Leap year

src/CalendarSettings/Jalali.php 1 location

@@ 310-345 (lines=36) @@
307
   *  example : Yekshanbe = result is 2
308
   *\_________________________________________________________/
309
  */
310
  'day_of_week' => function ($date_timem, $day_of_week) {
311
312
      $days_of_week = array(
313
          'Doshanbe',
314
          'Seshanbe',
315
          'Chaharshanbe',
316
          'Panjshanbe',
317
          'Jome',
318
          'Shanbe',
319
          'Yekshanbe',
320
      );
321
322
        $days = array(
323
          1 => 'Shanbe',
324
          2 => 'Yekshanbe',
325
          3 => 'Doshanbe',
326
          4 => 'Seshanbe',
327
          5 => 'Chaharshanbe',
328
          6 => 'Panjshanbe',
329
          7 => 'Jome' );
330
331
        $configGregorian = include 'Gregorian.php';
332
333
        $day = str_replace(
334
            $configGregorian[ 'days_of_week' ],
335
            $days_of_week,
336
            $day_of_week
337
        );
338
339
        foreach ($days as $key => $value) {
340
            if ($day == $value) {
341
                return $key;
342
            }
343
        }
344
345
  },
346
347
  /************************************************************
348
   *                       Leap year