@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | private function formatSettings(array $settings, array $declarativeSettings): array { |
117 | 117 | $settings = array_merge($settings, $declarativeSettings); |
118 | 118 | |
119 | - usort($settings, function ($first, $second) { |
|
119 | + usort($settings, function($first, $second) { |
|
120 | 120 | $priorityOne = $first instanceof ISettings ? $first->getPriority() : $first['priority']; |
121 | 121 | $priorityTwo = $second instanceof ISettings ? $second->getPriority() : $second['priority']; |
122 | 122 | return $priorityOne - $priorityTwo; |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $form = $setting->getForm(); |
129 | 129 | $html .= $form->renderAs('')->render(); |
130 | 130 | } else { |
131 | - $html .= '<div id="' . $setting['app'] . '_' . $setting['id'] . '"></div>'; |
|
131 | + $html .= '<div id="'.$setting['app'].'_'.$setting['id'].'"></div>'; |
|
132 | 132 | } |
133 | 133 | } |
134 | 134 | return ['content' => $html]; |
@@ -157,7 +157,7 @@ |
||
157 | 157 | 'message' => $this->l->t('Please provide an admin recovery password; otherwise, all account data will be lost.'), |
158 | 158 | ] |
159 | 159 | ]); |
160 | - } elseif ($recoveryEnabledForUser && ! $validRecoveryPassword) { |
|
160 | + } elseif ($recoveryEnabledForUser && !$validRecoveryPassword) { |
|
161 | 161 | return new JSONResponse([ |
162 | 162 | 'status' => 'error', |
163 | 163 | 'data' => [ |
@@ -65,7 +65,7 @@ |
||
65 | 65 | } catch (NotAdminException $e) { |
66 | 66 | throw $e; |
67 | 67 | } catch (Exception $e) { |
68 | - $this->logger->error('Failed to set declarative settings value: ' . $e->getMessage()); |
|
68 | + $this->logger->error('Failed to set declarative settings value: '.$e->getMessage()); |
|
69 | 69 | throw new OCSBadRequestException(); |
70 | 70 | } |
71 | 71 | } |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | if ($this->appManager->isEnabledForAnyone('app_api')) { |
98 | 98 | try { |
99 | 99 | Server::get(ExAppsPageService::class)->provideAppApiState($this->initialState); |
100 | - } catch (\Psr\Container\NotFoundExceptionInterface|\Psr\Container\ContainerExceptionInterface $e) { |
|
100 | + } catch (\Psr\Container\NotFoundExceptionInterface | \Psr\Container\ContainerExceptionInterface $e) { |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | $hashName = md5($fileName); |
154 | 154 | $allFiles = $folder->getDirectoryListing(); |
155 | 155 | // Try to find the file |
156 | - $file = array_filter($allFiles, function (ISimpleFile $file) use ($hashName) { |
|
156 | + $file = array_filter($allFiles, function(ISimpleFile $file) use ($hashName) { |
|
157 | 157 | return str_starts_with($file->getName(), $hashName); |
158 | 158 | }); |
159 | 159 | // Get the first entry |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $fileResponse = $client->get($fileName); |
166 | 166 | $contentType = $fileResponse->getHeader('Content-Type'); |
167 | 167 | $extension = $info['extension'] ?? ''; |
168 | - $file = $folder->newFile($hashName . '.' . base64_encode($contentType) . '.' . $extension, $fileResponse->getBody()); |
|
168 | + $file = $folder->newFile($hashName.'.'.base64_encode($contentType).'.'.$extension, $fileResponse->getBody()); |
|
169 | 169 | } catch (\Throwable $e) { |
170 | 170 | $this->logger->warning('Could not load media file for app discover section', ['media_src' => $fileName, 'exception' => $e]); |
171 | 171 | return new NotFoundResponse(); |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | if ($url === '') { |
252 | 252 | return ''; |
253 | 253 | } |
254 | - return 'https://usercontent.apps.nextcloud.com/' . base64_encode($url); |
|
254 | + return 'https://usercontent.apps.nextcloud.com/'.base64_encode($url); |
|
255 | 255 | } |
256 | 256 | |
257 | 257 | private function fetchApps() { |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | } |
325 | 325 | |
326 | 326 | // Extend existing app details |
327 | - $apps = array_map(function (array $appData) use ($dependencyAnalyzer, $ignoreMaxApps) { |
|
327 | + $apps = array_map(function(array $appData) use ($dependencyAnalyzer, $ignoreMaxApps) { |
|
328 | 328 | if (isset($appData['appstoreData'])) { |
329 | 329 | $appstoreData = $appData['appstoreData']; |
330 | 330 | $appData['screenshot'] = $this->createProxyPreviewUrl($appstoreData['screenshots'][0]['url'] ?? ''); |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | 'missingMaxOwnCloudVersion' => false, |
479 | 479 | 'missingMinOwnCloudVersion' => false, |
480 | 480 | 'canInstall' => true, |
481 | - 'screenshot' => isset($app['screenshots'][0]['url']) ? 'https://usercontent.apps.nextcloud.com/' . base64_encode($app['screenshots'][0]['url']) : '', |
|
481 | + 'screenshot' => isset($app['screenshots'][0]['url']) ? 'https://usercontent.apps.nextcloud.com/'.base64_encode($app['screenshots'][0]['url']) : '', |
|
482 | 482 | 'score' => $app['ratingOverall'], |
483 | 483 | 'ratingNumOverall' => $app['ratingNumOverall'], |
484 | 484 | 'ratingNumThresholdReached' => $app['ratingNumOverall'] > 5, |
@@ -627,8 +627,8 @@ discard block |
||
627 | 627 | } |
628 | 628 | |
629 | 629 | private function sortApps($a, $b) { |
630 | - $a = (string)$a['name']; |
|
631 | - $b = (string)$b['name']; |
|
630 | + $a = (string) $a['name']; |
|
631 | + $b = (string) $b['name']; |
|
632 | 632 | if ($a === $b) { |
633 | 633 | return 0; |
634 | 634 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | #[NoAdminRequired] |
24 | 24 | #[NoCSRFRequired] |
25 | 25 | public function getPdf() { |
26 | - $data = file_get_contents(__DIR__ . '/../../data/Reasons to use Nextcloud.pdf'); |
|
26 | + $data = file_get_contents(__DIR__.'/../../data/Reasons to use Nextcloud.pdf'); |
|
27 | 27 | |
28 | 28 | $resp = new DataDisplayResponse($data); |
29 | 29 | $resp->addHeader('Content-Type', 'application/pdf'); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | ]; |
146 | 146 | |
147 | 147 | if (!$isLDAPUsed && $this->appManager->isEnabledForUser('user_ldap')) { |
148 | - $isLDAPUsed = (bool)array_reduce($this->userManager->getBackends(), function ($ldapFound, $backend) { |
|
148 | + $isLDAPUsed = (bool) array_reduce($this->userManager->getBackends(), function($ldapFound, $backend) { |
|
149 | 149 | return $ldapFound || $backend instanceof User_Proxy; |
150 | 150 | }); |
151 | 151 | } |
@@ -156,12 +156,12 @@ discard block |
||
156 | 156 | if (!$isLDAPUsed) { |
157 | 157 | if ($isAdmin || $isDelegatedAdmin) { |
158 | 158 | $disabledUsers = $this->userManager->countDisabledUsers(); |
159 | - $userCount = array_reduce($this->userManager->countUsers(), function ($v, $w) { |
|
160 | - return $v + (int)$w; |
|
159 | + $userCount = array_reduce($this->userManager->countUsers(), function($v, $w) { |
|
160 | + return $v + (int) $w; |
|
161 | 161 | }, 0); |
162 | 162 | } else { |
163 | 163 | // User is subadmin ! |
164 | - [$userCount,$disabledUsers] = $this->userManager->countUsersAndDisabledUsersOfGroups($groupsInfo->getGroups(), self::COUNT_LIMIT_FOR_SUBADMINS); |
|
164 | + [$userCount, $disabledUsers] = $this->userManager->countUsersAndDisabledUsersOfGroups($groupsInfo->getGroups(), self::COUNT_LIMIT_FOR_SUBADMINS); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | if ($disabledUsers > 0) { |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $serverData['isDelegatedAdmin'] = $isDelegatedAdmin; |
210 | 210 | $serverData['sortGroups'] = $forceSortGroupByName |
211 | 211 | ? MetaData::SORT_GROUPNAME |
212 | - : (int)$this->config->getAppValue('core', 'group.sortBy', (string)MetaData::SORT_USERCOUNT); |
|
212 | + : (int) $this->config->getAppValue('core', 'group.sortBy', (string) MetaData::SORT_USERCOUNT); |
|
213 | 213 | $serverData['forceSortGroupByName'] = $forceSortGroupByName; |
214 | 214 | $serverData['quotaPreset'] = $quotaPreset; |
215 | 215 | $serverData['allowUnlimitedQuota'] = $allowUnlimitedQuota; |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | ], |
430 | 430 | Http::STATUS_OK |
431 | 431 | ); |
432 | - } catch (ForbiddenException|InvalidArgumentException|PropertyDoesNotExistException $e) { |
|
432 | + } catch (ForbiddenException | InvalidArgumentException | PropertyDoesNotExistException $e) { |
|
433 | 433 | return new DataResponse([ |
434 | 434 | 'status' => 'error', |
435 | 435 | 'data' => [ |
@@ -456,7 +456,7 @@ discard block |
||
456 | 456 | } |
457 | 457 | |
458 | 458 | $oldEmailAddress = $userAccount->getUser()->getSystemEMailAddress(); |
459 | - $oldEmailAddress = strtolower((string)$oldEmailAddress); |
|
459 | + $oldEmailAddress = strtolower((string) $oldEmailAddress); |
|
460 | 460 | if ($oldEmailAddress !== strtolower($userAccount->getProperty(IAccountManager::PROPERTY_EMAIL)->getValue())) { |
461 | 461 | // this is the only permission a backend provides and is also used |
462 | 462 | // for the permission of setting a email address |
@@ -499,11 +499,11 @@ discard block |
||
499 | 499 | |
500 | 500 | $userAccount = $this->accountManager->getAccount($user); |
501 | 501 | $cloudId = $user->getCloudId(); |
502 | - $message = 'Use my Federated Cloud ID to share with me: ' . $cloudId; |
|
502 | + $message = 'Use my Federated Cloud ID to share with me: '.$cloudId; |
|
503 | 503 | $signature = $this->signMessage($user, $message); |
504 | 504 | |
505 | - $code = $message . ' ' . $signature; |
|
506 | - $codeMd5 = $message . ' ' . md5($signature); |
|
505 | + $code = $message.' '.$signature; |
|
506 | + $codeMd5 = $message.' '.md5($signature); |
|
507 | 507 | |
508 | 508 | switch ($account) { |
509 | 509 | case 'verify-twitter': |
@@ -57,9 +57,9 @@ |
||
57 | 57 | 21, |
58 | 58 | ISecureRandom::CHAR_ALPHANUMERIC |
59 | 59 | ); |
60 | - $tokenValue = $this->timeFactory->getTime() . ':' . $token; |
|
60 | + $tokenValue = $this->timeFactory->getTime().':'.$token; |
|
61 | 61 | $mailAddress = ($user->getEMailAddress() !== null) ? $user->getEMailAddress() : ''; |
62 | - $encryptedValue = $this->crypto->encrypt($tokenValue, $mailAddress . $this->config->getSystemValue('secret')); |
|
62 | + $encryptedValue = $this->crypto->encrypt($tokenValue, $mailAddress.$this->config->getSystemValue('secret')); |
|
63 | 63 | $this->config->setUserValue($user->getUID(), 'core', 'lostpassword', $encryptedValue); |
64 | 64 | $link = $this->urlGenerator->linkToRouteAbsolute('core.lost.resetform', ['userId' => $user->getUID(), 'token' => $token]); |
65 | 65 | } else { |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | /** |
5 | 5 | * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors |
6 | 6 | * SPDX-License-Identifier: AGPL-3.0-or-later |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | foreach ($groups as $group) { |
44 | 44 | if ($group->getGroupId() === $groupId) { |
45 | 45 | $this->authorizedGroupService->delete($group->getId()); |
46 | - $io->success('Removed delegation of ' . $settingClass . ' to ' . $groupId . '.'); |
|
46 | + $io->success('Removed delegation of '.$settingClass.' to '.$groupId.'.'); |
|
47 | 47 | return 0; |
48 | 48 | } |
49 | 49 | } |
50 | 50 | |
51 | - $io->success('Group ' . $groupId . ' didn’t have delegation for ' . $settingClass . '.'); |
|
51 | + $io->success('Group '.$groupId.' didn’t have delegation for '.$settingClass.'.'); |
|
52 | 52 | |
53 | 53 | return 0; |
54 | 54 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | /** |
5 | 5 | * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors |
6 | 6 | * SPDX-License-Identifier: AGPL-3.0-or-later |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | protected function execute(InputInterface $input, OutputInterface $output): int { |
40 | 40 | $io = new SymfonyStyle($input, $output); |
41 | 41 | $settingClass = $input->getArgument('settingClass'); |
42 | - if (!in_array(IDelegatedSettings::class, (array)class_implements($settingClass), true)) { |
|
42 | + if (!in_array(IDelegatedSettings::class, (array) class_implements($settingClass), true)) { |
|
43 | 43 | $io->error('The specified class isn’t a valid delegated setting.'); |
44 | 44 | return 2; |
45 | 45 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | $this->authorizedGroupService->create($groupId, $settingClass); |
54 | 54 | |
55 | - $io->success('Administration of ' . $settingClass . ' delegated to ' . $groupId . '.'); |
|
55 | + $io->success('Administration of '.$settingClass.' delegated to '.$groupId.'.'); |
|
56 | 56 | |
57 | 57 | return 0; |
58 | 58 | } |