Code Duplication    Length = 4-4 lines in 3 locations

lib/private/Share20/Manager.php 3 locations

@@ 212-215 (lines=4) @@
209
		}
210
211
		// Cannot share with yourself
212
		if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER &&
213
			$share->getSharedWith() === $share->getSharedBy()) {
214
			throw new \InvalidArgumentException('Can\'t share with yourself');
215
		}
216
217
		// The path should be set
218
		if ($share->getNode() === null) {
@@ 613-616 (lines=4) @@
610
		}
611
612
		// Cannot share with the owner
613
		if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER &&
614
			$share->getSharedWith() === $share->getShareOwner()) {
615
			throw new \InvalidArgumentException('Can\'t share with the share owner');
616
		}
617
618
		// Generate the target
619
		$target = $this->config->getSystemValue('share_folder', '/') .'/'. $share->getNode()->getName();
@@ 703-706 (lines=4) @@
700
		}
701
702
		// Cannot share with the owner
703
		if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER &&
704
			$share->getSharedWith() === $share->getShareOwner()) {
705
			throw new \InvalidArgumentException('Can\'t share with the share owner');
706
		}
707
708
		$this->generalCreateChecks($share);
709