Code Duplication    Length = 10-11 lines in 3 locations

main/webservices/user_import/import.lib.php 1 location

@@ 128-137 (lines=10) @@
125
 * @param string $file Path to the CSV-file
126
 * @return array All userinformation read from the file
127
 */
128
function parse_csv_data($file) {
129
	$users = Import :: csvToArray($file);
130
	foreach ($users as $index => $user) {
131
		if (isset ($user['Courses'])) {
132
			$user['Courses'] = explode('|', trim($user['Courses']));
133
		}
134
		$users[$index] = $user;
135
	}
136
	return $users;
137
}
138

main/admin/user_update_import.php 1 location

@@ 241-251 (lines=11) @@
238
 * @param string $file Path to the CSV-file
239
 * @return array All userinformation read from the file
240
 */
241
function parse_csv_data($file)
242
{
243
    $users = Import :: csvToArray($file);
244
    foreach ($users as $index => $user) {
245
        if (isset ($user['Courses'])) {
246
            $user['Courses'] = explode('|', trim($user['Courses']));
247
        }
248
        $users[$index] = $user;
249
    }
250
    return $users;
251
}
252
/**
253
 * XML-parser: handle start of element
254
 * @param   string  $parser Deprecated?

main/inc/lib/myspace.lib.php 1 location

@@ 2327-2336 (lines=10) @@
2324
     * @param string $file Path to the CSV-file
2325
     * @return array All userinformation read from the file
2326
     */
2327
    function parse_csv_data($file)
2328
    {
2329
        $users = Import::csvToArray($file);
2330
        foreach ($users as $index => $user) {
2331
            if (isset ($user['Courses'])) {
2332
                $user['Courses'] = explode('|', trim($user['Courses']));
2333
            }
2334
            $users[$index] = $user;
2335
        }
2336
        return $users;
2337
    }
2338
2339
    /**