Code Duplication    Length = 7-8 lines in 2 locations

lib/private/Server.php 2 locations

@@ 870-876 (lines=7) @@
867
	 * @return \OCP\Files\Folder|null
868
	 */
869
	public function getUserFolder($userId = null) {
870
		if ($userId === null) {
871
			$user = $this->getUserSession()->getUser();
872
			if (!$user) {
873
				return null;
874
			}
875
			$userId = $user->getUID();
876
		}
877
		$root = $this->getRootFolder();
878
		return $root->getUserFolder($userId);
879
	}
@@ 1150-1157 (lines=8) @@
1147
	 * @return \OCP\ICertificateManager | null if $uid is null and no user is logged in
1148
	 */
1149
	public function getCertificateManager($userId = '') {
1150
		if ($userId === '') {
1151
			$userSession = $this->getUserSession();
1152
			$user = $userSession->getUser();
1153
			if (is_null($user)) {
1154
				return null;
1155
			}
1156
			$userId = $user->getUID();
1157
		}
1158
		return new CertificateManager($userId, new View(), $this->getConfig());
1159
	}
1160