Code Duplication    Length = 68-68 lines in 2 locations

modules/widgets/milestone/milestone.php 2 locations

@@ 281-348 (lines=68) @@
278
279
			if ( 'since' === $type ) {
280
281
				switch ( $data['unit'] ) {
282
					case 'years':
283
						$data['message'] = sprintf(
284
							_n(
285
								'<span class="difference">%s</span> <span class="label">year ago.</span>',
286
								'<span class="difference">%s</span> <span class="label">years ago.</span>',
287
								$interval,
288
								'jetpack'
289
							),
290
							$interval_text
291
						);
292
					break;
293
					case 'months':
294
						$data['message'] = sprintf(
295
							_n(
296
								'<span class="difference">%s</span> <span class="label">month ago.</span>',
297
								'<span class="difference">%s</span> <span class="label">months ago.</span>',
298
								$interval,
299
								'jetpack'
300
							),
301
							$interval_text
302
						);
303
					break;
304
					case 'days':
305
						$data['message'] = sprintf(
306
							_n(
307
								'<span class="difference">%s</span> <span class="label">day ago.</span>',
308
								'<span class="difference">%s</span> <span class="label">days ago.</span>',
309
								$interval,
310
								'jetpack'
311
							),
312
							$interval_text
313
						);
314
					break;
315
					case 'hours':
316
						$data['message'] = sprintf(
317
							_n(
318
								'<span class="difference">%s</span> <span class="label">hour ago.</span>',
319
								'<span class="difference">%s</span> <span class="label">hours ago.</span>',
320
								$interval,
321
								'jetpack'
322
							),
323
							$interval_text
324
						);
325
					break;
326
					case 'minutes':
327
						$data['message'] = sprintf(
328
							_n(
329
								'<span class="difference">%s</span> <span class="label">minute ago.</span>',
330
								'<span class="difference">%s</span> <span class="label">minutes ago.</span>',
331
								$interval,
332
								'jetpack'
333
							),
334
							$interval_text
335
						);
336
					break;
337
					case 'seconds':
338
						$data['message'] = sprintf(
339
							_n(
340
								'<span class="difference">%s</span> <span class="label">second ago.</span>',
341
								'<span class="difference">%s</span> <span class="label">seconds ago.</span>',
342
								$interval,
343
								'jetpack'
344
							),
345
							$interval_text
346
						);
347
					break;
348
				}
349
			} else {
350
				switch ( $this->get_unit( $diff, $instance['unit'] ) ) {
351
					case 'years':
@@ 350-417 (lines=68) @@
347
					break;
348
				}
349
			} else {
350
				switch ( $this->get_unit( $diff, $instance['unit'] ) ) {
351
					case 'years':
352
						$data['message'] = sprintf(
353
							_n(
354
								'<span class="difference">%s</span> <span class="label">year to go.</span>',
355
								'<span class="difference">%s</span> <span class="label">years to go.</span>',
356
								$interval,
357
								'jetpack'
358
							),
359
							$interval_text
360
						);
361
					break;
362
					case 'months':
363
						$data['message'] = sprintf(
364
							_n(
365
								'<span class="difference">%s</span> <span class="label">month to go.</span>',
366
								'<span class="difference">%s</span> <span class="label">months to go.</span>',
367
								$interval,
368
								'jetpack'
369
							),
370
							$interval_text
371
						);
372
					break;
373
					case 'days':
374
						$data['message'] = sprintf(
375
							_n(
376
								'<span class="difference">%s</span> <span class="label">day to go.</span>',
377
								'<span class="difference">%s</span> <span class="label">days to go.</span>',
378
								$interval,
379
								'jetpack'
380
							),
381
							$interval_text
382
						);
383
					break;
384
					case 'hours':
385
						$data['message'] = sprintf(
386
							_n(
387
								'<span class="difference">%s</span> <span class="label">hour to go.</span>',
388
								'<span class="difference">%s</span> <span class="label">hours to go.</span>',
389
								$interval,
390
								'jetpack'
391
							),
392
							$interval_text
393
						);
394
					break;
395
					case 'minutes':
396
						$data['message'] = sprintf(
397
							_n(
398
								'<span class="difference">%s</span> <span class="label">minute to go.</span>',
399
								'<span class="difference">%s</span> <span class="label">minutes to go.</span>',
400
								$interval,
401
								'jetpack'
402
							),
403
							$interval_text
404
						);
405
					break;
406
					case 'seconds':
407
						$data['message'] = sprintf(
408
							_n(
409
								'<span class="difference">%s</span> <span class="label">second to go.</span>',
410
								'<span class="difference">%s</span> <span class="label">seconds to go.</span>',
411
								$interval,
412
								'jetpack'
413
							),
414
							$interval_text
415
						);
416
					break;
417
				}
418
			}
419
			$data['message'] = '<div class="milestone-countdown">' . $data['message'] . '</div>';
420
		}