Code Duplication    Length = 15-15 lines in 2 locations

apps/sharebymail/lib/ShareByMailProvider.php 1 location

@@ 950-964 (lines=15) @@
947
	 * @return \OCP\Files\File|\OCP\Files\Folder
948
	 * @throws InvalidShare
949
	 */
950
	private function getNode($userId, $id) {
951
		try {
952
			$userFolder = $this->rootFolder->getUserFolder($userId);
953
		} catch (NoUserException $e) {
954
			throw new InvalidShare();
955
		}
956
957
		$nodes = $userFolder->getById($id);
958
959
		if (empty($nodes)) {
960
			throw new InvalidShare();
961
		}
962
963
		return $nodes[0];
964
	}
965
966
	/**
967
	 * A user is deleted from the system

apps/federatedfilesharing/lib/FederatedShareProvider.php 1 location

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