Code Duplication    Length = 41-42 lines in 2 locations

mod/gc_api/lib/profile.php 1 location

@@ 1110-1151 (lines=42) @@
1107
	return $user_entity;
1108
}
1109
1110
function buildDate($month, $year){
1111
	switch($month){
1112
		case 1:
1113
			$string = "01/";
1114
			break;
1115
		case 2:
1116
			$string = "02/";
1117
			break;
1118
		case 3:
1119
			$string = "03/";
1120
			break;
1121
		case 4:
1122
			$string = "04/";
1123
			break;
1124
		case 5:
1125
			$string = "05/";
1126
			break;
1127
		case 6:
1128
			$string = "06/";
1129
			break;
1130
		case 7:
1131
			$string = "07/";
1132
			break;
1133
		case 8:
1134
			$string = "08/";
1135
			break;
1136
		case 9:
1137
			$string = "09/";
1138
			break;
1139
		case 10:
1140
			$string = "10/";
1141
			break;
1142
		case 11:
1143
			$string = "11/";
1144
			break;
1145
		case 12:
1146
			$string = "12/";
1147
			break;
1148
	}	
1149
	return $string.$year;
1150
1151
}

mod/gc_mobile_api/models/user.php 1 location

@@ 163-203 (lines=41) @@
160
	false
161
);
162
163
function build_date($month, $year){
164
	switch($month){
165
		case 1:
166
			$string = "01/";
167
			break;
168
		case 2:
169
			$string = "02/";
170
			break;
171
		case 3:
172
			$string = "03/";
173
			break;
174
		case 4:
175
			$string = "04/";
176
			break;
177
		case 5:
178
			$string = "05/";
179
			break;
180
		case 6:
181
			$string = "06/";
182
			break;
183
		case 7:
184
			$string = "07/";
185
			break;
186
		case 8:
187
			$string = "08/";
188
			break;
189
		case 9:
190
			$string = "09/";
191
			break;
192
		case 10:
193
			$string = "10/";
194
			break;
195
		case 11:
196
			$string = "11/";
197
			break;
198
		case 12:
199
			$string = "12/";
200
			break;
201
	}	
202
	return $string . $year;
203
}
204
205
function get_user_data( $profileemail, $user, $lang ){
206
	$user_entity = is_numeric($profileemail) ? get_user($profileemail) : ( strpos($profileemail, '@') !== FALSE ? get_user_by_email($profileemail)[0] : get_user_by_username($profileemail) );