Code Duplication    Length = 7-7 lines in 2 locations

lib/private/Share/Share.php 2 locations

@@ 782-788 (lines=7) @@
779
					$groupsShareWith = $groupManager->getUserGroupIds($userShareWith);
780
				}
781
				$inGroup = array_intersect($groupsOwner, $groupsShareWith);
782
				if (empty($inGroup)) {
783
					$message = 'Sharing %s failed, because the user '
784
						.'%s is not a member of any groups that %s is a member of';
785
					$message_t = $l->t('Sharing %s failed, because the user %s is not a member of any groups that %s is a member of', array($itemName, $shareWith, $uidOwner));
786
					\OCP\Util::writeLog('OCP\Share', sprintf($message, $itemName, $shareWith, $uidOwner), \OCP\Util::DEBUG);
787
					throw new \Exception($message_t);
788
				}
789
			}
790
			// Check if the item source is already shared with the user, either from the same owner or a different user
791
			if ($checkExists = self::getItems($itemType, $itemSource, self::$shareTypeUserAndGroups,
@@ 2494-2500 (lines=7) @@
2491
			$result['suggestedFileTarget'] = null;
2492
			$result['itemSource'] = $itemSource;
2493
			$result['expirationDate'] = $expirationDate;
2494
			if (!$backend->isValidSource($itemSource, $uidOwner)) {
2495
				$message = 'Sharing %s failed, because the sharing backend for '
2496
					.'%s could not find its source';
2497
				$message_t = $l->t('Sharing %s failed, because the sharing backend for %s could not find its source', array($itemSource, $itemType));
2498
				\OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSource, $itemType), \OCP\Util::DEBUG);
2499
				throw new \Exception($message_t);
2500
			}
2501
			if ($backend instanceof \OCP\Share_Backend_File_Dependent) {
2502
				$result['filePath'] = $backend->getFilePath($itemSource, $uidOwner);
2503
				if ($itemType == 'file' || $itemType == 'folder') {