Code Duplication    Length = 9-9 lines in 2 locations

mod/cp_notifications/start.php 2 locations

@@ 1238-1246 (lines=9) @@
1235
			$container = get_entity($container_entity->container_guid);
1236
1237
			// the user creating the content is automatically subscribed to it
1238
			if (elgg_instanceof($container, 'group')) {
1239
	 			if($container->isMember($user_comment)){
1240
					add_entity_relationship($object->getOwnerGUID(), 'cp_subscribed_to_email', $container_entity->getGUID());
1241
					add_entity_relationship($object->getOwnerGUID(), 'cp_subscribed_to_site_mail', $container_entity->getGUID());
1242
				}
1243
			} else {
1244
				add_entity_relationship($object->getOwnerGUID(), 'cp_subscribed_to_email', $container_entity->getGUID());
1245
				add_entity_relationship($object->getOwnerGUID(), 'cp_subscribed_to_site_mail', $container_entity->getGUID());
1246
			}
1247
1248
1249
			$to_recipients = get_subscribers($dbprefix, $object->getOwnerGUID(), $object->getContainerGUID());
@@ 1308-1316 (lines=9) @@
1305
1306
			// the user creating the content is automatically subscribed to it (with exception that is not a widget, forum, etc..)
1307
			$cp_whitelist = array('blog', 'bookmarks', 'poll', 'groupforumtopic', 'image', 'idea', 'page', 'page_top', 'thewire', 'task_top', 'question', 'answer', 'cp_wire_image','event_calendar');
1308
			if (in_array($object->getSubtype(), $cp_whitelist)) {
1309
1310
				if ($object->getSubtype() == 'answer') {// subcribed to the question
1311
					add_entity_relationship($object->getOwnerGUID(), 'cp_subscribed_to_email', $object->getContainerGUID());
1312
					add_entity_relationship($object->getOwnerGUID(), 'cp_subscribed_to_site_mail', $object->getContainerGUID());
1313
				}
1314
				add_entity_relationship($object->getOwnerGUID(), 'cp_subscribed_to_email', $object->getGUID());
1315
				add_entity_relationship($object->getOwnerGUID(), 'cp_subscribed_to_site_mail', $object->getGUID());
1316
            }
1317
1318
			$user = get_user($object->owner_guid);
1319
			$group = $object->getContainerEntity();