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

@@ 922-936 (lines=15) @@
919
	 * @return \OCP\Files\File|\OCP\Files\Folder
920
	 * @throws InvalidShare
921
	 */
922
	private function getNode($userId, $id) {
923
		try {
924
			$userFolder = $this->rootFolder->getUserFolder($userId);
925
		} catch (NotFoundException $e) {
926
			throw new InvalidShare();
927
		}
928
929
		$nodes = $userFolder->getById($id);
930
931
		if (empty($nodes)) {
932
			throw new InvalidShare();
933
		}
934
935
		return $nodes[0];
936
	}
937
938
	/**
939
	 * A user is deleted from the system