Code Duplication    Length = 12-13 lines in 2 locations

application/models/User_Model.php 2 locations

@@ 88-100 (lines=13) @@
85
		return $email;
86
	}
87
88
	public function get_user_by_username(string $username) {
89
		$user = NULL;
90
91
		$query = $this->db->select('*')
92
		                  ->from('auth_users')
93
		                  ->where('username', $username)
94
		                  ->get();
95
96
		if($query->num_rows() > 0) {
97
			$user = $query->row();
98
		}
99
		return $user;
100
	}
101
102
	public function get_gravatar_url($email = NULL, $size = NULL) : string {
103
		$email = $email ?? $this->email;
@@ 120-131 (lines=12) @@
117
		return $api_key;
118
	}
119
	
120
	public function get_id_from_api_key(string $api_key) {
121
		$query = $this->db->select('id')
122
		                  ->from('auth_users')
123
		                  ->where('api_key', $api_key)
124
		                  ->get();
125
126
		if($query->num_rows() > 0) {
127
			$userID = $query->row('id');
128
		}
129
130
		return $userID ?? FALSE;
131
	}
132
133
	public function set_user_expire_time($remember) : int {
134
		$expire_time = 0;