Skip to content

Commit d1fb939

Browse files
Merge pull request nextcloud#8338 from nextcloud/simplify-return-statement
Simplify return statement
2 parents ff1b343 + e2974f1 commit d1fb939

File tree

9 files changed

+13
-33
lines changed

9 files changed

+13
-33
lines changed

apps/dav/lib/CardDAV/SyncService.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,7 @@ private function buildSyncCollectionRequestBody($syncToken) {
236236
$root->appendChild($sync);
237237
$root->appendChild($prop);
238238
$dom->appendChild($root);
239-
$body = $dom->saveXML();
240-
241-
return $body;
239+
return $dom->saveXML();
242240
}
243241

244242
/**

apps/dav/lib/Connector/Sabre/Auth.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@ protected function validateUserPass($username, $password) {
152152
*/
153153
function check(RequestInterface $request, ResponseInterface $response) {
154154
try {
155-
$result = $this->auth($request, $response);
156-
return $result;
155+
return $this->auth($request, $response);
157156
} catch (NotAuthenticated $e) {
158157
throw $e;
159158
} catch (Exception $e) {

apps/dav/lib/Upload/UploadHome.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ private function impl() {
9090
}
9191
$view = new View('/' . $user->getUID() . '/uploads');
9292
$rootInfo = $view->getFileInfo('');
93-
$impl = new Directory($view, $rootInfo);
94-
return $impl;
93+
return new Directory($view, $rootInfo);
9594
}
9695
}

apps/encryption/lib/Crypto/Crypt.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,7 @@ public function symmetricEncryptFileContent($plainContent, $passPhrase, $version
196196
// combine content to encrypt the IV identifier and actual IV
197197
$catFile = $this->concatIV($encryptedContent, $iv);
198198
$catFile = $this->concatSig($catFile, $sig);
199-
$padded = $this->addPadding($catFile);
200-
201-
return $padded;
199+
return $this->addPadding($catFile);
202200
}
203201

204202
/**
@@ -495,8 +493,7 @@ private function checkSignature($data, $passPhrase, $expectedSignature) {
495493
*/
496494
private function createSignature($data, $passPhrase) {
497495
$passPhrase = hash('sha512', $passPhrase . 'a', true);
498-
$signature = hash_hmac('sha256', $data, $passPhrase);
499-
return $signature;
496+
return hash_hmac('sha256', $data, $passPhrase);
500497
}
501498

502499

apps/files_sharing/lib/Helper.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,7 @@ public static function stripUserFilesPath($path) {
210210
}
211211

212212
$sliced = array_slice($split, 2);
213-
$relPath = implode('/', $sliced);
214-
215-
return $relPath;
213+
return implode('/', $sliced);
216214
}
217215

218216
/**

apps/user_ldap/lib/Access.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,7 @@ public function getDomainDNFromDN($dn) {
419419
$domainParts[] = $part;
420420
}
421421
}
422-
$domainDN = implode(',', $domainParts);
423-
return $domainDN;
422+
return implode(',', $domainParts);
424423
}
425424

426425
/**
@@ -800,8 +799,7 @@ private function createAltInternalOwnCloudName($name, $isUser) {
800799
public function fetchUsersByLoginName($loginName, $attributes = array('dn')) {
801800
$loginName = $this->escapeFilterPart($loginName);
802801
$filter = str_replace('%uid', $loginName, $this->connection->ldapLoginFilter);
803-
$users = $this->fetchListOfUsers($filter, $attributes);
804-
return $users;
802+
return $this->fetchListOfUsers($filter, $attributes);
805803
}
806804

807805
/**
@@ -814,8 +812,7 @@ public function fetchUsersByLoginName($loginName, $attributes = array('dn')) {
814812
public function countUsersByLoginName($loginName) {
815813
$loginName = $this->escapeFilterPart($loginName);
816814
$filter = str_replace('%uid', $loginName, $this->connection->ldapLoginFilter);
817-
$users = $this->countUsers($filter);
818-
return $users;
815+
return $this->countUsers($filter);
819816
}
820817

821818
/**

apps/user_ldap/lib/Group_LDAP.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,7 @@ private function prepareFilterForUsersHasGidNumber($groupDN, $search = '') {
370370
}
371371
$filterParts[] = $this->access->connection->ldapGidNumber .'=' . $groupID;
372372

373-
$filter = $this->access->combineFilterWithAnd($filterParts);
374-
375-
return $filter;
373+
return $this->access->combineFilterWithAnd($filterParts);
376374
}
377375

378376
/**
@@ -534,9 +532,7 @@ private function prepareFilterForUsersInPrimaryGroup($groupDN, $search = '') {
534532
}
535533
$filterParts[] = 'primaryGroupID=' . $groupID;
536534

537-
$filter = $this->access->combineFilterWithAnd($filterParts);
538-
539-
return $filter;
535+
return $this->access->combineFilterWithAnd($filterParts);
540536
}
541537

542538
/**

apps/user_ldap/lib/Jobs/CleanUp.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,7 @@ public function isCleanUpAllowed() {
172172
return false;
173173
}
174174

175-
$enabled = $this->isCleanUpEnabled();
176-
177-
return $enabled;
175+
return $this->isCleanUpEnabled();
178176
}
179177

180178
/**

lib/private/Files/Storage/Wrapper/Encryption.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,9 +351,7 @@ public function copy($path1, $path2) {
351351
// need to stream copy file by file in case we copy between a encrypted
352352
// and a unencrypted storage
353353
$this->unlink($path2);
354-
$result = $this->copyFromStorage($this, $path1, $path2);
355-
356-
return $result;
354+
return $this->copyFromStorage($this, $path1, $path2);
357355
}
358356

359357
/**

0 commit comments

Comments
 (0)