Merge pull request #8338 from nextcloud/simplify-return-statement

Simplify return statement
This commit is contained in:
Joas Schilling 2018-02-14 10:08:28 +01:00 committed by GitHub
commit d1fb939e86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 13 additions and 33 deletions

View File

@ -236,9 +236,7 @@ class SyncService {
$root->appendChild($sync); $root->appendChild($sync);
$root->appendChild($prop); $root->appendChild($prop);
$dom->appendChild($root); $dom->appendChild($root);
$body = $dom->saveXML(); return $dom->saveXML();
return $body;
} }
/** /**

View File

@ -152,8 +152,7 @@ class Auth extends AbstractBasic {
*/ */
function check(RequestInterface $request, ResponseInterface $response) { function check(RequestInterface $request, ResponseInterface $response) {
try { try {
$result = $this->auth($request, $response); return $this->auth($request, $response);
return $result;
} catch (NotAuthenticated $e) { } catch (NotAuthenticated $e) {
throw $e; throw $e;
} catch (Exception $e) { } catch (Exception $e) {

View File

@ -90,7 +90,6 @@ class UploadHome implements ICollection {
} }
$view = new View('/' . $user->getUID() . '/uploads'); $view = new View('/' . $user->getUID() . '/uploads');
$rootInfo = $view->getFileInfo(''); $rootInfo = $view->getFileInfo('');
$impl = new Directory($view, $rootInfo); return new Directory($view, $rootInfo);
return $impl;
} }
} }

View File

@ -196,9 +196,7 @@ class Crypt {
// combine content to encrypt the IV identifier and actual IV // combine content to encrypt the IV identifier and actual IV
$catFile = $this->concatIV($encryptedContent, $iv); $catFile = $this->concatIV($encryptedContent, $iv);
$catFile = $this->concatSig($catFile, $sig); $catFile = $this->concatSig($catFile, $sig);
$padded = $this->addPadding($catFile); return $this->addPadding($catFile);
return $padded;
} }
/** /**
@ -495,8 +493,7 @@ class Crypt {
*/ */
private function createSignature($data, $passPhrase) { private function createSignature($data, $passPhrase) {
$passPhrase = hash('sha512', $passPhrase . 'a', true); $passPhrase = hash('sha512', $passPhrase . 'a', true);
$signature = hash_hmac('sha256', $data, $passPhrase); return hash_hmac('sha256', $data, $passPhrase);
return $signature;
} }

View File

@ -210,9 +210,7 @@ class Helper {
} }
$sliced = array_slice($split, 2); $sliced = array_slice($split, 2);
$relPath = implode('/', $sliced); return implode('/', $sliced);
return $relPath;
} }
/** /**

View File

@ -419,8 +419,7 @@ class Access extends LDAPUtility implements IUserTools {
$domainParts[] = $part; $domainParts[] = $part;
} }
} }
$domainDN = implode(',', $domainParts); return implode(',', $domainParts);
return $domainDN;
} }
/** /**
@ -800,8 +799,7 @@ class Access extends LDAPUtility implements IUserTools {
public function fetchUsersByLoginName($loginName, $attributes = array('dn')) { public function fetchUsersByLoginName($loginName, $attributes = array('dn')) {
$loginName = $this->escapeFilterPart($loginName); $loginName = $this->escapeFilterPart($loginName);
$filter = str_replace('%uid', $loginName, $this->connection->ldapLoginFilter); $filter = str_replace('%uid', $loginName, $this->connection->ldapLoginFilter);
$users = $this->fetchListOfUsers($filter, $attributes); return $this->fetchListOfUsers($filter, $attributes);
return $users;
} }
/** /**
@ -814,8 +812,7 @@ class Access extends LDAPUtility implements IUserTools {
public function countUsersByLoginName($loginName) { public function countUsersByLoginName($loginName) {
$loginName = $this->escapeFilterPart($loginName); $loginName = $this->escapeFilterPart($loginName);
$filter = str_replace('%uid', $loginName, $this->connection->ldapLoginFilter); $filter = str_replace('%uid', $loginName, $this->connection->ldapLoginFilter);
$users = $this->countUsers($filter); return $this->countUsers($filter);
return $users;
} }
/** /**

View File

@ -370,9 +370,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
} }
$filterParts[] = $this->access->connection->ldapGidNumber .'=' . $groupID; $filterParts[] = $this->access->connection->ldapGidNumber .'=' . $groupID;
$filter = $this->access->combineFilterWithAnd($filterParts); return $this->access->combineFilterWithAnd($filterParts);
return $filter;
} }
/** /**
@ -534,9 +532,7 @@ class Group_LDAP extends BackendUtility implements \OCP\GroupInterface, IGroupLD
} }
$filterParts[] = 'primaryGroupID=' . $groupID; $filterParts[] = 'primaryGroupID=' . $groupID;
$filter = $this->access->combineFilterWithAnd($filterParts); return $this->access->combineFilterWithAnd($filterParts);
return $filter;
} }
/** /**

View File

@ -172,9 +172,7 @@ class CleanUp extends TimedJob {
return false; return false;
} }
$enabled = $this->isCleanUpEnabled(); return $this->isCleanUpEnabled();
return $enabled;
} }
/** /**

View File

@ -351,9 +351,7 @@ class Encryption extends Wrapper {
// need to stream copy file by file in case we copy between a encrypted // need to stream copy file by file in case we copy between a encrypted
// and a unencrypted storage // and a unencrypted storage
$this->unlink($path2); $this->unlink($path2);
$result = $this->copyFromStorage($this, $path1, $path2); return $this->copyFromStorage($this, $path1, $path2);
return $result;
} }
/** /**