Code Duplication    Length = 13-13 lines in 4 locations

application/models/History_Model.php 4 locations

@@ 27-39 (lines=13) @@
24
	}
25
26
	/*** USER HISTORY ***/
27
	public function userAddTitle(int $chapterID, string $chapter, string $category) : bool {
28
		$success = $this->db->insert('tracker_titles_history', [
29
			'chapter_id'  => $chapterID,
30
31
			'type'        => '1',
32
			'custom1'     => $chapter,
33
			'custom2'     => $category,
34
35
			'updated_at'  => date('Y-m-d H:i:s')
36
		]);
37
38
		return $success;
39
	}
40
	public function userUpdateTitle(int $chapterID, string $old_chapter, string $new_chapter) : bool {
41
		$success = $this->db->insert('tracker_titles_history', [
42
			'chapter_id'  => $chapterID,
@@ 40-52 (lines=13) @@
37
38
		return $success;
39
	}
40
	public function userUpdateTitle(int $chapterID, string $old_chapter, string $new_chapter) : bool {
41
		$success = $this->db->insert('tracker_titles_history', [
42
			'chapter_id'  => $chapterID,
43
44
			'type'        => '2',
45
			'custom1'     => $old_chapter,
46
			'custom2'     => $new_chapter,
47
48
			'updated_at'  => date('Y-m-d H:i:s')
49
		]);
50
51
		return $success;
52
	}
53
	public function userRemoveTitle(int $chapterID) : bool {
54
		$success = $this->db->insert('tracker_titles_history', [
55
			'chapter_id'  => $chapterID,
@@ 64-76 (lines=13) @@
61
62
		return $success;
63
	}
64
	public function userUpdateTags(int $chapterID, string/*|null*/ $old_tags, string $new_tags) : bool {
65
		$success = $this->db->insert('tracker_titles_history', [
66
			'chapter_id'  => $chapterID,
67
68
			'type'        => '4',
69
			'custom1'     => $old_tags,
70
			'custom2'     => $new_tags,
71
72
			'updated_at'  => date('Y-m-d H:i:s')
73
		]);
74
75
		return $success;
76
	}
77
	public function userUpdateCategory(int $chapterID, string $old_category, string $new_category) : bool {
78
		$success = $this->db->insert('tracker_titles_history', [
79
			'chapter_id'  => $chapterID,
@@ 77-89 (lines=13) @@
74
75
		return $success;
76
	}
77
	public function userUpdateCategory(int $chapterID, string $old_category, string $new_category) : bool {
78
		$success = $this->db->insert('tracker_titles_history', [
79
			'chapter_id'  => $chapterID,
80
81
			'type'        => '5',
82
			'custom1'     => $old_category,
83
			'custom2'     => $new_category,
84
85
			'updated_at'  => date('Y-m-d H:i:s')
86
		]);
87
88
		return $success;
89
	}
90
}
91