diff options
author | Joas Schilling <coding@schilljs.com> | 2018-01-26 10:15:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-26 10:15:39 +0100 |
commit | c2b1bd92d6f6e675f7ffab420cd61c5be701c4a6 (patch) | |
tree | 10e093ff030f1436fe3862c4b1944dbcf050723d /apps | |
parent | fab951e4b3d103b68b21ccb864d229c4023b57ac (diff) | |
parent | 0a56d2185e79caf81f5160cb8503955d9c3108a6 (diff) | |
download | nextcloud-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 'apps')
-rw-r--r-- | apps/dav/lib/CardDAV/Converter.php | 3 | ||||
-rw-r--r-- | apps/dav/lib/Connector/Sabre/FilesPlugin.php | 3 | ||||
-rw-r--r-- | apps/encryption/lib/Util.php | 3 | ||||
-rw-r--r-- | apps/federatedfilesharing/lib/AddressHandler.php | 3 | ||||
-rw-r--r-- | apps/files_external/3rdparty/icewind/smb/src/Share.php | 3 | ||||
-rw-r--r-- | apps/files_external/lib/Service/UserStoragesService.php | 3 | ||||
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareesAPIController.php | 4 | ||||
-rw-r--r-- | apps/files_sharing/lib/ShareBackend/Folder.php | 4 | ||||
-rw-r--r-- | apps/files_trashbin/lib/Storage.php | 3 | ||||
-rw-r--r-- | apps/twofactor_backupcodes/lib/Provider/BackupCodesProvider.php | 3 | ||||
-rw-r--r-- | apps/user_ldap/lib/Helper.php | 3 |
11 files changed, 11 insertions, 24 deletions
diff --git a/apps/dav/lib/CardDAV/Converter.php b/apps/dav/lib/CardDAV/Converter.php index a480f0ea45d..e047ee2a772 100644 --- a/apps/dav/lib/CardDAV/Converter.php +++ b/apps/dav/lib/CardDAV/Converter.php @@ -143,8 +143,7 @@ class Converter { */ private function getAvatarImage(IUser $user) { try { - $image = $user->getAvatarImage(-1); - return $image; + return $user->getAvatarImage(-1); } catch (\Exception $ex) { return null; } diff --git a/apps/dav/lib/Connector/Sabre/FilesPlugin.php b/apps/dav/lib/Connector/Sabre/FilesPlugin.php index a3a0893259b..b5333f48374 100644 --- a/apps/dav/lib/Connector/Sabre/FilesPlugin.php +++ b/apps/dav/lib/Connector/Sabre/FilesPlugin.php @@ -340,8 +340,7 @@ class FilesPlugin extends ServerPlugin { }); $propFind->handle(self::IS_ENCRYPTED_PROPERTYNAME, function() use ($node) { - $result = $node->getFileInfo()->isEncrypted() ? '1' : '0'; - return $result; + return $node->getFileInfo()->isEncrypted() ? '1' : '0'; }); $propFind->handle(self::HAS_PREVIEW_PROPERTYNAME, function () use ($node) { diff --git a/apps/encryption/lib/Util.php b/apps/encryption/lib/Util.php index 5926817dc48..eb2357bd10f 100644 --- a/apps/encryption/lib/Util.php +++ b/apps/encryption/lib/Util.php @@ -196,8 +196,7 @@ class Util { * @return \OC\Files\Storage\Storage */ public function getStorage($path) { - $storage = $this->files->getMount($path)->getStorage(); - return $storage; + return $this->files->getMount($path)->getStorage(); } } diff --git a/apps/federatedfilesharing/lib/AddressHandler.php b/apps/federatedfilesharing/lib/AddressHandler.php index 78234f17ed7..be3a624e28f 100644 --- a/apps/federatedfilesharing/lib/AddressHandler.php +++ b/apps/federatedfilesharing/lib/AddressHandler.php @@ -84,8 +84,7 @@ class AddressHandler { * @return string url of the current server */ public function generateRemoteURL() { - $url = $this->urlGenerator->getAbsoluteURL('/'); - return $url; + return $this->urlGenerator->getAbsoluteURL('/'); } /** diff --git a/apps/files_external/3rdparty/icewind/smb/src/Share.php b/apps/files_external/3rdparty/icewind/smb/src/Share.php index 8f1dace2be2..be1ba025508 100644 --- a/apps/files_external/3rdparty/icewind/smb/src/Share.php +++ b/apps/files_external/3rdparty/icewind/smb/src/Share.php @@ -370,8 +370,7 @@ class Share extends AbstractShare { protected function execute($command) { $this->connect(); $this->connection->write($command . PHP_EOL); - $output = $this->connection->read(); - return $output; + return $this->connection->read(); } /** diff --git a/apps/files_external/lib/Service/UserStoragesService.php b/apps/files_external/lib/Service/UserStoragesService.php index b225f1eec8c..db03befa852 100644 --- a/apps/files_external/lib/Service/UserStoragesService.php +++ b/apps/files_external/lib/Service/UserStoragesService.php @@ -112,8 +112,7 @@ class UserStoragesService extends StoragesService { */ public function addStorage(StorageConfig $newStorage) { $newStorage->setApplicableUsers([$this->getUser()->getUID()]); - $config = parent::addStorage($newStorage); - return $config; + return parent::addStorage($newStorage); } /** diff --git a/apps/files_sharing/lib/Controller/ShareesAPIController.php b/apps/files_sharing/lib/Controller/ShareesAPIController.php index 575bf01fdb0..742962e6490 100644 --- a/apps/files_sharing/lib/Controller/ShareesAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareesAPIController.php @@ -230,9 +230,7 @@ class ShareesAPIController extends OCSController { $url = $this->urlGenerator->getAbsoluteURL('/ocs/v1.php/apps/files_sharing/api/v1/sharees') . '?'; } $params['page'] = $page + 1; - $link = '<' . $url . http_build_query($params) . '>; rel="next"'; - - return $link; + return '<' . $url . http_build_query($params) . '>; rel="next"'; } /** diff --git a/apps/files_sharing/lib/ShareBackend/Folder.php b/apps/files_sharing/lib/ShareBackend/Folder.php index 80b141326d3..c48a26300a2 100644 --- a/apps/files_sharing/lib/ShareBackend/Folder.php +++ b/apps/files_sharing/lib/ShareBackend/Folder.php @@ -73,9 +73,7 @@ class Folder extends File implements \OCP\Share_Backend_Collection { $query = \OCP\DB::prepare('SELECT `parent` FROM `*PREFIX*filecache` WHERE `fileid` = ?'); $result = $query->execute(array($child)); $row = $result->fetchRow(); - $parent = $row ? $row['parent'] : null; - - return $parent; + return $row ? $row['parent'] : null; } public function getChildren($itemSource) { diff --git a/apps/files_trashbin/lib/Storage.php b/apps/files_trashbin/lib/Storage.php index e6609034f91..3025d36a210 100644 --- a/apps/files_trashbin/lib/Storage.php +++ b/apps/files_trashbin/lib/Storage.php @@ -254,8 +254,7 @@ class Storage extends Wrapper { * @return MoveToTrashEvent */ protected function createMoveToTrashEvent(Node $node) { - $event = new MoveToTrashEvent($node); - return $event; + return new MoveToTrashEvent($node); } /** diff --git a/apps/twofactor_backupcodes/lib/Provider/BackupCodesProvider.php b/apps/twofactor_backupcodes/lib/Provider/BackupCodesProvider.php index 5c5500862e6..f5b01649bbb 100644 --- a/apps/twofactor_backupcodes/lib/Provider/BackupCodesProvider.php +++ b/apps/twofactor_backupcodes/lib/Provider/BackupCodesProvider.php @@ -90,8 +90,7 @@ class BackupCodesProvider implements IProvider { * @return Template */ public function getTemplate(IUser $user) { - $tmpl = new Template('twofactor_backupcodes', 'challenge'); - return $tmpl; + return new Template('twofactor_backupcodes', 'challenge'); } /** diff --git a/apps/user_ldap/lib/Helper.php b/apps/user_ldap/lib/Helper.php index 3157a7ab09d..3d1ae31cfef 100644 --- a/apps/user_ldap/lib/Helper.php +++ b/apps/user_ldap/lib/Helper.php @@ -123,8 +123,7 @@ class Helper { sort($serverConnections); $lastKey = array_pop($serverConnections); $lastNumber = intval(str_replace('s', '', $lastKey)); - $nextPrefix = 's' . str_pad($lastNumber + 1, 2, '0', STR_PAD_LEFT); - return $nextPrefix; + return 's' . str_pad($lastNumber + 1, 2, '0', STR_PAD_LEFT); } private function getServersConfig($value) { |