Code Duplication    Length = 9-11 lines in 2 locations

lib/Controller/ShareController.php 2 locations

@@ 59-67 (lines=9) @@
56
		$limit = 3;
57
		$offset = null;
58
		$result = [];
59
		foreach ($this->groupManager->search($search, $limit, $offset) as $idx => $group) {
60
			$acl = new Acl();
61
			$acl->setType('group');
62
			$acl->setParticipant($group->getGID());
63
			$acl->setPermissionEdit(true);
64
			$acl->setPermissionShare(true);
65
			$acl->setPermissionManage(true);
66
			$result[] = $acl;
67
		}
68
		$limit = 10;
69
		foreach ($this->userManager->searchDisplayName($search, $limit, $offset) as $idx => $user) {
70
			if ($user->getUID() === $this->userId) {
@@ 69-79 (lines=11) @@
66
			$result[] = $acl;
67
		}
68
		$limit = 10;
69
		foreach ($this->userManager->searchDisplayName($search, $limit, $offset) as $idx => $user) {
70
			if ($user->getUID() === $this->userId) {
71
							continue;
72
			}
73
			$acl = new Acl();
74
			$acl->setType('user');
75
			$acl->setParticipant($user->getUID());
76
			$acl->setPermissionEdit(true);
77
			$acl->setPermissionShare(true);
78
			$acl->setPermissionManage(true);
79
			$result[] = $acl;
80
		}
81
		return $result;
82
	}