Code Duplication    Length = 7-7 lines in 2 locations

lib/private/Share/Share.php 2 locations

@@ 462-468 (lines=7) @@
459
					$groupsShareWith = $groupManager->getUserGroupIds($userShareWith);
460
				}
461
				$inGroup = array_intersect($groupsOwner, $groupsShareWith);
462
				if (empty($inGroup)) {
463
					$message = 'Sharing %s failed, because the user '
464
						.'%s is not a member of any groups that %s is a member of';
465
					$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));
466
					\OCP\Util::writeLog('OCP\Share', sprintf($message, $itemName, $shareWith, $uidOwner), \OCP\Util::DEBUG);
467
					throw new \Exception($message_t);
468
				}
469
			}
470
			// Check if the item source is already shared with the user, either from the same owner or a different user
471
			if ($checkExists = self::getItems($itemType, $itemSource, self::$shareTypeUserAndGroups,
@@ 1750-1756 (lines=7) @@
1747
			$result['suggestedFileTarget'] = null;
1748
			$result['itemSource'] = $itemSource;
1749
			$result['expirationDate'] = $expirationDate;
1750
			if (!$backend->isValidSource($itemSource, $uidOwner)) {
1751
				$message = 'Sharing %s failed, because the sharing backend for '
1752
					.'%s could not find its source';
1753
				$message_t = $l->t('Sharing %s failed, because the sharing backend for %s could not find its source', array($itemSource, $itemType));
1754
				\OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSource, $itemType), \OCP\Util::DEBUG);
1755
				throw new \Exception($message_t);
1756
			}
1757
			if ($backend instanceof \OCP\Share_Backend_File_Dependent) {
1758
				$result['filePath'] = $backend->getFilePath($itemSource, $uidOwner);
1759
				if ($itemType == 'file' || $itemType == 'folder') {