Code Duplication    Length = 3-4 lines in 2 locations

classes/Elgg/Roles/Api.php 2 locations

@@ 252-254 (lines=3) @@
249
				$current_role->title = $rdetails['title'];
250
				$current_role->setExtends($rdetails['extends']);
251
				$current_role->setPermissions($rdetails['permissions']);
252
				if ($current_role->save()) {
253
					elgg_log("Permissions for role '$rname' have been updated: " . print_r($rdetails['permissions'], true), 'DEBUG');
254
				}
255
			} else {
256
				elgg_log("Creating a new role '$rname'", 'DEBUG');
257
				// Create new role object
@@ 270-273 (lines=4) @@
267
					$new_role->name = $rname;
268
					$new_role->setExtends($rdetails['extends']);
269
					$new_role->setPermissions($rdetails['permissions']);
270
					if ($new_role->save()) {
271
						elgg_log("Role object with guid $new_role->guid has been created", 'DEBUG');
272
						elgg_log("Permissions for '$rname' have been set: " . print_r($rdetails['permissions'], true), 'DEBUG');
273
					}
274
				}
275
			}
276
		}