Code Duplication    Length = 4-4 lines in 3 locations

lib/private/Share20/Manager.php 3 locations

@@ 204-207 (lines=4) @@
201
		}
202
203
		// Cannot share with yourself
204
		if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER &&
205
			$share->getSharedWith() === $share->getSharedBy()) {
206
			throw new \InvalidArgumentException('Can\'t share with yourself');
207
		}
208
209
		// The path should be set
210
		if ($share->getNode() === null) {
@@ 602-605 (lines=4) @@
599
		}
600
601
		// Cannot share with the owner
602
		if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER &&
603
			$share->getSharedWith() === $share->getShareOwner()) {
604
			throw new \InvalidArgumentException('Can\'t share with the share owner');
605
		}
606
607
		// Generate the target
608
		$target = $this->config->getSystemValue('share_folder', '/') .'/'. $share->getNode()->getName();
@@ 692-695 (lines=4) @@
689
		}
690
691
		// Cannot share with the owner
692
		if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER &&
693
			$share->getSharedWith() === $share->getShareOwner()) {
694
			throw new \InvalidArgumentException('Can\'t share with the share owner');
695
		}
696
697
		$this->generalCreateChecks($share);
698