summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2018-01-26 09:49:30 +0100
committerGitHub <noreply@github.com>2018-01-26 09:49:30 +0100
commit43ed8b446c86569158fc17fdbfc7f83eb1d807a9 (patch)
treefa6779443cb7f675b520fb78354641eba16f55a6 /lib/private
parentaebb443ca5f7909dc1bea663ac0a707bafca07b2 (diff)
parent16a558871cf371aec59dfb2ec7b672f0a4ab166f (diff)
downloadnextcloud-server-43ed8b446c86569158fc17fdbfc7f83eb1d807a9.tar.gz
nextcloud-server-43ed8b446c86569158fc17fdbfc7f83eb1d807a9.zip
Merge pull request #8060 from nextcloud/proper-codeflow
Use proper code flow instead of not needed else branch
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Files/Cache/Cache.php3
-rw-r--r--lib/private/User/Session.php22
2 files changed, 12 insertions, 13 deletions
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php
index cf017c73960..428f52fd9ef 100644
--- a/lib/private/Files/Cache/Cache.php
+++ b/lib/private/Files/Cache/Cache.php
@@ -208,9 +208,8 @@ class Cache implements ICache {
return array_map(function (array $data) {
return self::cacheEntryFromData($data, $this->mimetypeLoader);;
}, $files);
- } else {
- return array();
}
+ return [];
}
/**
diff --git a/lib/private/User/Session.php b/lib/private/User/Session.php
index 34319760c86..c2b58c37cdb 100644
--- a/lib/private/User/Session.php
+++ b/lib/private/User/Session.php
@@ -295,15 +295,15 @@ class Session implements IUserSession, Emitter {
public function getLoginName() {
if ($this->activeUser) {
return $this->session->get('loginname');
- } else {
- $uid = $this->session->get('user_id');
- if ($uid) {
- $this->activeUser = $this->manager->get($uid);
- return $this->session->get('loginname');
- } else {
- return null;
- }
}
+
+ $uid = $this->session->get('user_id');
+ if ($uid) {
+ $this->activeUser = $this->manager->get($uid);
+ return $this->session->get('loginname');
+ }
+
+ return null;
}
/**
@@ -369,10 +369,10 @@ class Session implements IUserSession, Emitter {
if($this->isLoggedIn()) {
$this->prepareUserLogin($firstTimeLogin, $regenerateSessionId);
return true;
- } else {
- $message = \OC::$server->getL10N('lib')->t('Login canceled by app');
- throw new LoginException($message);
}
+
+ $message = \OC::$server->getL10N('lib')->t('Login canceled by app');
+ throw new LoginException($message);
}
/**