Code Duplication    Length = 17-18 lines in 3 locations

mod/cp_notifications/lib/functions.php 3 locations

@@ 311-327 (lines=17) @@
308
			$notification_entry = json_encode($content_array);
309
			break;
310
311
		case 'mission':
312
313
			$content_array = array(
314
				'content_title' => $entity->title,
315
				'content_author_name' => $entity->getOwnerEntity()->name,
316
				'content_url' => $entity->getURL()."?utm_source=notification_digest&utm_medium=email",
317
				'subtype' => $entity->job_type,
318
				'deadline' => $entity->deadline
319
			);
320
321
			$entity_guid = $entity->guid;
322
			$user_guid = $send_to->getGUID();
323
			$entry_type = 'mission';
324
			$group_name = NULL;
325
			$action_type = 'new_post';
326
			$notification_entry = json_encode($content_array);
327
			break;
328
329
		case 'comment':
330
		case 'discussion_reply':
@@ 489-506 (lines=18) @@
486
			$notification_entry = json_encode($content_array);			
487
			break;
488
489
		case 'cp_wire_image':
490
491
			$content_array = array(
492
				'content_description' => $entity->description,
493
				'content_url' => $content_url."?utm_source=notification_digest&utm_medium=email",
494
				'subtype' => $entity->getSubtype(),
495
				'content_author_name' => $invoked_by->name,
496
				'content_author_url' => $invoked_by->getURL(),
497
				'wire_image' => thewire_image_get_attachments($entity->guid),
498
			);
499
500
			$entity_guid = $entity->guid;
501
			$user_guid = $send_to->getGUID();
502
			$entry_type = 'personal';
503
			$group_name = NULL;
504
			$action_type = 'new_post';
505
			$notification_entry = json_encode($content_array);
506
			break;
507
508
		case 'cp_wire_mention':
509
@@ 526-542 (lines=17) @@
523
524
			break;
525
526
		case 'cp_mention':
527
528
			$content_array = array(
529
				'content_title' => $entity->getContainerEntity()->title,
530
				'content_url' => $content_url."?utm_source=notification_digest&utm_medium=email",
531
				'subtype' => $entity->getContainerEntity()->getSubtype(),
532
				'content_author' => $invoked_by->name,
533
				'content_author_url' => $invoked_by->getURL()
534
			);
535
536
			$entity_guid = $entity->guid;
537
			$user_guid = $send_to->getGUID();
538
			$entry_type = 'personal';
539
			$group_name = NULL;
540
			$action_type = 'mention';
541
			$notification_entry = json_encode($content_array);
542
			break;
543
544
		default:
545