Code Duplication    Length = 15-15 lines in 2 locations

apps/federatedfilesharing/lib/FederatedShareProvider.php 1 location

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

apps/sharebymail/lib/ShareByMailProvider.php 1 location

@@ 938-952 (lines=15) @@
935
	 * @return \OCP\Files\File|\OCP\Files\Folder
936
	 * @throws InvalidShare
937
	 */
938
	private function getNode($userId, $id) {
939
		try {
940
			$userFolder = $this->rootFolder->getUserFolder($userId);
941
		} catch (NoUserException $e) {
942
			throw new InvalidShare();
943
		}
944
945
		$nodes = $userFolder->getById($id);
946
947
		if (empty($nodes)) {
948
			throw new InvalidShare();
949
		}
950
951
		return $nodes[0];
952
	}
953
954
	/**
955
	 * A user is deleted from the system