Code Duplication    Length = 15-15 lines in 2 locations

apps/federatedfilesharing/lib/FederatedShareProvider.php 1 location

@@ 883-897 (lines=15) @@
880
	 * @return \OCP\Files\File|\OCP\Files\Folder
881
	 * @throws InvalidShare
882
	 */
883
	private function getNode($userId, $id) {
884
		try {
885
			$userFolder = $this->rootFolder->getUserFolder($userId);
886
		} catch (NotFoundException $e) {
887
			throw new InvalidShare();
888
		}
889
890
		$nodes = $userFolder->getById($id);
891
892
		if (empty($nodes)) {
893
			throw new InvalidShare();
894
		}
895
896
		return $nodes[0];
897
	}
898
899
	/**
900
	 * A user is deleted from the system

apps/sharebymail/lib/ShareByMailProvider.php 1 location

@@ 719-733 (lines=15) @@
716
	 * @return \OCP\Files\File|\OCP\Files\Folder
717
	 * @throws InvalidShare
718
	 */
719
	private function getNode($userId, $id) {
720
		try {
721
			$userFolder = $this->rootFolder->getUserFolder($userId);
722
		} catch (NotFoundException $e) {
723
			throw new InvalidShare();
724
		}
725
726
		$nodes = $userFolder->getById($id);
727
728
		if (empty($nodes)) {
729
			throw new InvalidShare();
730
		}
731
732
		return $nodes[0];
733
	}
734
735
	/**
736
	 * A user is deleted from the system