Code Duplication    Length = 4-5 lines in 2 locations

apps/files_sharing/lib/Controller/Share20OcsController.php 1 location

@@ 890-893 (lines=4) @@
887
		$recipientList = [];
888
		if ($shareType === \OCP\Share::SHARE_TYPE_USER) {
889
			$recipientList[] = $this->userManager->get($recipient);
890
		} elseif ($shareType === \OCP\Share::SHARE_TYPE_GROUP) {
891
			$group = \OC::$server->getGroupManager()->get($recipient);
892
			$recipientList = $group->searchUsers('');
893
		}
894
		// don't send a mail to the user who shared the file
895
		$recipientList = \array_filter($recipientList, function ($user) {
896
			/** @var IUser $user */

lib/private/Share/Share.php 1 location

@@ 1047-1051 (lines=5) @@
1044
				$listOfUnsharedItems = \array_merge($listOfUnsharedItems, $deletedShares, [$shareTmp]);
1045
				$itemUnshared = true;
1046
				break;
1047
			} elseif ((int)$share['share_type'] === \OCP\Share::SHARE_TYPE_GROUP) {
1048
				if (\OC::$server->getGroupManager()->inGroup($uid, $share['share_with'])) {
1049
					$groupShare = $share;
1050
				}
1051
			} elseif ((int)$share['share_type'] === self::$shareTypeGroupUserUnique &&
1052
				$share['share_with'] === $uid) {
1053
				$uniqueGroupShare = $share;
1054
			}