Code Duplication    Length = 15-15 lines in 2 locations

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

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