Code Duplication    Length = 5-7 lines in 4 locations

lib/private/Files/Filesystem.php 1 location

@@ 410-416 (lines=7) @@
407
		$userManager = \OC::$server->getUserManager();
408
		$userObject = $userManager->get($user);
409
410
		if ($userObject === null) {
411
			$msg = "Backends provided no user object for $user";
412
			\OC::$server->getLogger()->error($msg, ['app' => __CLASS__]);
413
			// reset flag, this will make it possible to rethrow the exception if called again
414
			unset(self::$usersSetup[$user]);
415
			throw new \OC\User\NoUserException($msg);
416
		}
417
418
		$realUid = $userObject->getUID();
419
		// workaround in case of different casings

lib/private/Files/Node/Root.php 1 location

@@ 348-352 (lines=5) @@
345
	public function getUserFolder($userId) {
346
		$userObject = \OC::$server->getUserManager()->get($userId);
347
348
		if ($userObject === null) {
349
			$msg = "Backends provided no user object for $userId";
350
			\OC::$server->getLogger()->error($msg, ['app' => __CLASS__]);
351
			throw new NoUserException($msg);
352
		}
353
354
		$userId = $userObject->getUID();
355

apps/files_versions/lib/Storage.php 1 location

@@ 693-697 (lines=5) @@
690
			// get available disk space for user
691
			$user = \OC::$server->getUserManager()->get($uid);
692
693
			if ($user === null) {
694
				$msg = "Backends provided no user object for $uid";
695
				\OC::$server->getLogger()->error($msg, ['app' => __CLASS__]);
696
				throw new \OC\User\NoUserException($msg);
697
			}
698
699
			\OC_Util::setupFS($uid);
700

lib/private/Share/Share.php 1 location

@@ 106-110 (lines=5) @@
103
		$userManager = \OC::$server->getUserManager();
104
		$userObject = $userManager->get($ownerUser);
105
106
		if ($userObject === null) {
107
			$msg = "Backends provided no user object for $ownerUser";
108
			\OC::$server->getLogger()->error($msg, ['app' => __CLASS__]);
109
			throw new \OC\User\NoUserException($msg);
110
		}
111
112
		$ownerUser = $userObject->getUID();
113