summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2018-01-26 10:15:39 +0100
committerGitHub <noreply@github.com>2018-01-26 10:15:39 +0100
commitc2b1bd92d6f6e675f7ffab420cd61c5be701c4a6 (patch)
tree10e093ff030f1436fe3862c4b1944dbcf050723d /lib
parentfab951e4b3d103b68b21ccb864d229c4023b57ac (diff)
parent0a56d2185e79caf81f5160cb8503955d9c3108a6 (diff)
downloadnextcloud-server-c2b1bd92d6f6e675f7ffab420cd61c5be701c4a6.tar.gz
nextcloud-server-c2b1bd92d6f6e675f7ffab420cd61c5be701c4a6.zip
Merge pull request #8063 from nextcloud/inline-value
Return value immediately instead of assigning to a one-time variable
Diffstat (limited to 'lib')
-rw-r--r--lib/private/App/Platform.php3
-rw-r--r--lib/private/Files/View.php9
-rw-r--r--lib/private/Security/CertificateManager.php4
-rw-r--r--lib/private/Server.php4
-rw-r--r--lib/private/legacy/db.php3
-rw-r--r--lib/private/legacy/db/statementwrapper.php3
6 files changed, 8 insertions, 18 deletions
diff --git a/lib/private/App/Platform.php b/lib/private/App/Platform.php
index 344e420b7d3..fe4d7ff48f7 100644
--- a/lib/private/App/Platform.php
+++ b/lib/private/App/Platform.php
@@ -94,7 +94,6 @@ class Platform {
public function getLibraryVersion($name) {
$repo = new PlatformRepository();
- $lib = $repo->findLibrary($name);
- return $lib;
+ return $repo->findLibrary($name);
}
}
diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php
index fb0b116666e..a6971cb0205 100644
--- a/lib/private/Files/View.php
+++ b/lib/private/Files/View.php
@@ -426,8 +426,7 @@ class View {
flush();
}
fclose($handle);
- $size = $this->filesize($path);
- return $size;
+ return $this->filesize($path);
}
return false;
}
@@ -476,8 +475,7 @@ class View {
echo fread($handle, $len);
flush();
}
- $size = ftell($handle) - $from;
- return $size;
+ return ftell($handle) - $from;
}
throw new \OCP\Files\UnseekableException('fseek error');
@@ -1083,8 +1081,7 @@ class View {
}
list($storage, $internalPath) = Filesystem::resolvePath($absolutePath . $postFix);
if ($storage) {
- $result = $storage->hash($type, $internalPath, $raw);
- return $result;
+ return $storage->hash($type, $internalPath, $raw);
}
}
return null;
diff --git a/lib/private/Security/CertificateManager.php b/lib/private/Security/CertificateManager.php
index 90ad7de9b59..a213a5b3b9b 100644
--- a/lib/private/Security/CertificateManager.php
+++ b/lib/private/Security/CertificateManager.php
@@ -249,9 +249,7 @@ class CertificateManager implements ICertificateManager {
if ($uid === '') {
$uid = $this->uid;
}
- $path = is_null($uid) ? '/files_external/' : '/' . $uid . '/files_external/';
-
- return $path;
+ return is_null($uid) ? '/files_external/' : '/' . $uid . '/files_external/';
}
/**
diff --git a/lib/private/Server.php b/lib/private/Server.php
index c0fb96dce86..1f572280c7c 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -243,9 +243,7 @@ class Server extends ServerContainer implements IServerContainer {
$this->registerService('SystemTagManagerFactory', function (Server $c) {
$config = $c->getConfig();
$factoryClass = $config->getSystemValue('systemtags.managerFactory', '\OC\SystemTag\ManagerFactory');
- /** @var \OC\SystemTag\ManagerFactory $factory */
- $factory = new $factoryClass($this);
- return $factory;
+ return new $factoryClass($this);
});
$this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) {
return $c->query('SystemTagManagerFactory')->getManager();
diff --git a/lib/private/legacy/db.php b/lib/private/legacy/db.php
index 6e487e25ad5..7c556baeaeb 100644
--- a/lib/private/legacy/db.php
+++ b/lib/private/legacy/db.php
@@ -170,8 +170,7 @@ class OC_DB {
*/
public static function createDbFromStructure( $file ) {
$schemaManager = self::getMDB2SchemaManager();
- $result = $schemaManager->createDbFromStructure($file);
- return $result;
+ return $schemaManager->createDbFromStructure($file);
}
/**
diff --git a/lib/private/legacy/db/statementwrapper.php b/lib/private/legacy/db/statementwrapper.php
index 7c3c4776aa7..12774c894e8 100644
--- a/lib/private/legacy/db/statementwrapper.php
+++ b/lib/private/legacy/db/statementwrapper.php
@@ -77,8 +77,7 @@ class OC_DB_StatementWrapper {
return false;
}
if ($this->isManipulation) {
- $count = $this->statement->rowCount();
- return $count;
+ return $this->statement->rowCount();
} else {
return $this;
}