Code Duplication    Length = 4-4 lines in 3 locations

lib/private/Share20/Manager.php 3 locations

@@ 187-190 (lines=4) @@
184
		}
185
186
		// Cannot share with yourself
187
		if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER &&
188
			$share->getSharedWith() === $share->getSharedBy()) {
189
			throw new \InvalidArgumentException('Can\'t share with yourself');
190
		}
191
192
		// The path should be set
193
		if ($share->getNode() === null) {
@@ 560-563 (lines=4) @@
557
		}
558
559
		// Cannot share with the owner
560
		if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER &&
561
			$share->getSharedWith() === $share->getShareOwner()) {
562
			throw new \InvalidArgumentException('Can\'t share with the share owner');
563
		}
564
565
		// Generate the target
566
		$target = $this->config->getSystemValue('share_folder', '/') .'/'. $share->getNode()->getName();
@@ 647-650 (lines=4) @@
644
		}
645
646
		// Cannot share with the owner
647
		if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER &&
648
			$share->getSharedWith() === $share->getShareOwner()) {
649
			throw new \InvalidArgumentException('Can\'t share with the share owner');
650
		}
651
652
		$this->generalCreateChecks($share);
653