Code Duplication    Length = 8-9 lines in 2 locations

lib/Service/OwnNoteGroupService.php 2 locations

@@ 43-51 (lines=9) @@
40
		$this->noteService = $noteService;
41
	}
42
43
	public function deleteGroup($FOLDER, $group) {
44
		// We actually need to just rename all the notes
45
		$uid = \OC::$server->getUserSession()->getUser()->getUID();
46
		$results = $this->noteMapper->findNotesByGroup($group, $uid);
47
		foreach ($results as $result) {
48
			$this->noteService->renameNote($FOLDER, $result->getId(), $result->getName(), '');
49
		}
50
		return true;
51
	}
52
53
	public function renameGroup($FOLDER, $group, $newgroup) {
54
		$uid = \OC::$server->getUserSession()->getUser()->getUID();
@@ 53-60 (lines=8) @@
50
		return true;
51
	}
52
53
	public function renameGroup($FOLDER, $group, $newgroup) {
54
		$uid = \OC::$server->getUserSession()->getUser()->getUID();
55
		$results = $this->noteMapper->findNotesByGroup($group, $uid);
56
		foreach ($results as $result) {
57
			$this->noteService->renameNote($FOLDER, $result->getId(), $result->getName(), $newgroup);
58
		}
59
		return true;
60
	}
61
62
}
63