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

@@ 761-775 (lines=15) @@
758
	 * @return \OCP\Files\File|\OCP\Files\Folder
759
	 * @throws InvalidShare
760
	 */
761
	private function getNode($userId, $id) {
762
		try {
763
			$userFolder = $this->rootFolder->getUserFolder($userId);
764
		} catch (NotFoundException $e) {
765
			throw new InvalidShare();
766
		}
767
768
		$nodes = $userFolder->getById($id);
769
770
		if (empty($nodes)) {
771
			throw new InvalidShare();
772
		}
773
774
		return $nodes[0];
775
	}
776
777
	/**
778
	 * A user is deleted from the system