diff --git a/apps/files_external/lib/Lib/Storage/AmazonS3.php b/apps/files_external/lib/Lib/Storage/AmazonS3.php
index 7c536443a0ef7e8d2ee405ccd803a0099baddc12..03a24e89765f3a344efd8593f99aa84fde08b46d 100644
--- a/apps/files_external/lib/Lib/Storage/AmazonS3.php
+++ b/apps/files_external/lib/Lib/Storage/AmazonS3.php
@@ -232,7 +232,6 @@ class AmazonS3 extends \OC\Files\Storage\Common {
 		} catch (\Exception $e) {
 			return $this->batchDelete();
 		}
-		return false;
 	}
 
 	private function batchDelete($path = null) {
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php
index cf017c73960c5f7eb0914c25b40aab1c6eef3ac1..428f52fd9efa645cf9c5fbc10d865bc3739a3603 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 34319760c86d8c735cd0407129f7d086d9475d0c..c2b58c37cdbe9bd89ff47eacdee3289759770012 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);
 	}
 
 	/**