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

@@ 121-161 (lines=41) @@
118
	false
119
);
120
121
function build_date($month, $year){
122
	switch($month){
123
		case 1:
124
			$string = "01/";
125
			break;
126
		case 2:
127
			$string = "02/";
128
			break;
129
		case 3:
130
			$string = "03/";
131
			break;
132
		case 4:
133
			$string = "04/";
134
			break;
135
		case 5:
136
			$string = "05/";
137
			break;
138
		case 6:
139
			$string = "06/";
140
			break;
141
		case 7:
142
			$string = "07/";
143
			break;
144
		case 8:
145
			$string = "08/";
146
			break;
147
		case 9:
148
			$string = "09/";
149
			break;
150
		case 10:
151
			$string = "10/";
152
			break;
153
		case 11:
154
			$string = "11/";
155
			break;
156
		case 12:
157
			$string = "12/";
158
			break;
159
	}	
160
	return $string . $year;
161
}
162
163
function get_user_data( $profileemail, $user, $lang ){
164
	$user_entity = is_numeric($profileemail) ? get_user($profileemail) : ( strpos($profileemail, '@') !== FALSE ? get_user_by_email($profileemail)[0] : get_user_by_username($profileemail) );