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

@@ 910-924 (lines=15) @@
907
	 * @return \OCP\Files\File|\OCP\Files\Folder
908
	 * @throws InvalidShare
909
	 */
910
	private function getNode($userId, $id) {
911
		try {
912
			$userFolder = $this->rootFolder->getUserFolder($userId);
913
		} catch (NotFoundException $e) {
914
			throw new InvalidShare();
915
		}
916
917
		$nodes = $userFolder->getById($id);
918
919
		if (empty($nodes)) {
920
			throw new InvalidShare();
921
		}
922
923
		return $nodes[0];
924
	}
925
926
	/**
927
	 * A user is deleted from the system