Code Duplication    Length = 4-4 lines in 3 locations

lib/private/share20/manager.php 3 locations

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