Code Duplication    Length = 12-13 lines in 2 locations

Sources/Likes.php 1 location

@@ 325-337 (lines=13) @@
322
323
		// Add a background task to process sending alerts.
324
		// Mod author, you can add your own background task for your own custom like event using the "integrate_issue_like" hook or your callback, both are immediately called after this.
325
		if ($this->_type == 'msg')
326
			$smcFunc['db_insert']('insert',
327
				'{db_prefix}background_tasks',
328
				array('task_file' => 'string', 'task_class' => 'string', 'task_data' => 'string', 'claimed_time' => 'int'),
329
				array('$sourcedir/tasks/Likes-Notify.php', 'Likes_Notify_Background', json_encode(array(
330
					'content_id' => $content,
331
					'content_type' => $type,
332
					'sender_id' => $user['id'],
333
					'sender_name' => $user['name'],
334
					'time' => $time,
335
				)), 0),
336
				array('id_task')
337
			);
338
339
		// Are we calling this directly? if so, set a proper data for the response. Do note that __METHOD__ returns both the class name and the function name.
340
		if ($this->_sa == __FUNCTION__)

Sources/Subs-Post.php 1 location

@@ 2032-2043 (lines=12) @@
2029
		updateLastMessages($topicOptions['board'], $new_topic || !empty($topicOptions['is_approved']) ? $msgOptions['id'] : 0);
2030
2031
	// Queue createPost background notification
2032
	if ($msgOptions['send_notifications'] && $msgOptions['approved'])
2033
		$smcFunc['db_insert']('',
2034
			'{db_prefix}background_tasks',
2035
			array('task_file' => 'string', 'task_class' => 'string', 'task_data' => 'string', 'claimed_time' => 'int'),
2036
			array('$sourcedir/tasks/CreatePost-Notify.php', 'CreatePost_Notify_Background', json_encode(array(
2037
				'msgOptions' => $msgOptions,
2038
				'topicOptions' => $topicOptions,
2039
				'posterOptions' => $posterOptions,
2040
				'type' => $new_topic ? 'topic' : 'reply',
2041
			)), 0),
2042
			array('id_task')
2043
		);
2044
2045
	// Alright, done now... we can abort now, I guess... at least this much is done.
2046
	ignore_user_abort($previous_ignore_user_abort);