Code Duplication    Length = 7-7 lines in 2 locations

lib/private/Share/Share.php 2 locations

@@ 464-470 (lines=7) @@
461
					$groupsShareWith = $groupManager->getUserGroupIds($userShareWith);
462
				}
463
				$inGroup = array_intersect($groupsOwner, $groupsShareWith);
464
				if (empty($inGroup)) {
465
					$message = 'Sharing %s failed, because the user '
466
						.'%s is not a member of any groups that %s is a member of';
467
					$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));
468
					\OCP\Util::writeLog('OCP\Share', sprintf($message, $itemName, $shareWith, $uidOwner), \OCP\Util::DEBUG);
469
					throw new \Exception($message_t);
470
				}
471
			}
472
			// Check if the item source is already shared with the user, either from the same owner or a different user
473
			if ($checkExists = self::getItems($itemType, $itemSource, self::$shareTypeUserAndGroups,
@@ 1827-1833 (lines=7) @@
1824
			$result['suggestedFileTarget'] = null;
1825
			$result['itemSource'] = $itemSource;
1826
			$result['expirationDate'] = $expirationDate;
1827
			if (!$backend->isValidSource($itemSource, $uidOwner)) {
1828
				$message = 'Sharing %s failed, because the sharing backend for '
1829
					.'%s could not find its source';
1830
				$message_t = $l->t('Sharing %s failed, because the sharing backend for %s could not find its source', array($itemSource, $itemType));
1831
				\OCP\Util::writeLog('OCP\Share', sprintf($message, $itemSource, $itemType), \OCP\Util::DEBUG);
1832
				throw new \Exception($message_t);
1833
			}
1834
			if ($backend instanceof \OCP\Share_Backend_File_Dependent) {
1835
				$result['filePath'] = $backend->getFilePath($itemSource, $uidOwner);
1836
				if ($itemType == 'file' || $itemType == 'folder') {