@@ -109,9 +109,9 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | protected function run($argument) { |
| 111 | 111 | |
| 112 | - $try = (int)$argument['try'] + 1; |
|
| 112 | + $try = (int) $argument['try'] + 1; |
|
| 113 | 113 | |
| 114 | - switch($argument['type']) { |
|
| 114 | + switch ($argument['type']) { |
|
| 115 | 115 | case AccountManager::PROPERTY_WEBSITE: |
| 116 | 116 | $result = $this->verifyWebsite($argument); |
| 117 | 117 | break; |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | break; |
| 122 | 122 | default: |
| 123 | 123 | // no valid type given, no need to retry |
| 124 | - $this->logger->error($argument['type'] . ' is no valid type for user account data.'); |
|
| 124 | + $this->logger->error($argument['type'].' is no valid type for user account data.'); |
|
| 125 | 125 | $result = true; |
| 126 | 126 | } |
| 127 | 127 | |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | |
| 141 | 141 | $result = false; |
| 142 | 142 | |
| 143 | - $url = rtrim($argument['data'], '/') . '/.well-known/' . 'CloudIdVerificationCode.txt'; |
|
| 143 | + $url = rtrim($argument['data'], '/').'/.well-known/'.'CloudIdVerificationCode.txt'; |
|
| 144 | 144 | |
| 145 | 145 | $client = $this->httpClientService->newClient(); |
| 146 | 146 | try { |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | $user = $this->userManager->get($argument['uid']); |
| 158 | 158 | // we don't check a valid user -> give up |
| 159 | 159 | if ($user === null) { |
| 160 | - $this->logger->error($argument['uid'] . ' doesn\'t exist, can\'t verify user data.'); |
|
| 160 | + $this->logger->error($argument['uid'].' doesn\'t exist, can\'t verify user data.'); |
|
| 161 | 161 | return $result; |
| 162 | 162 | } |
| 163 | 163 | $userData = $this->accountManager->getUser($user); |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | * @return bool true if we could check the verification code, otherwise false |
| 183 | 183 | */ |
| 184 | 184 | protected function verifyViaLookupServer(array $argument, $dataType) { |
| 185 | - if(empty($this->lookupServerUrl) || $this->config->getSystemValue('has_internet_connection', true) === false) { |
|
| 185 | + if (empty($this->lookupServerUrl) || $this->config->getSystemValue('has_internet_connection', true) === false) { |
|
| 186 | 186 | return false; |
| 187 | 187 | } |
| 188 | 188 | |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | |
| 191 | 191 | // we don't check a valid user -> give up |
| 192 | 192 | if ($user === null) { |
| 193 | - $this->logger->info($argument['uid'] . ' doesn\'t exist, can\'t verify user data.'); |
|
| 193 | + $this->logger->info($argument['uid'].' doesn\'t exist, can\'t verify user data.'); |
|
| 194 | 194 | return true; |
| 195 | 195 | } |
| 196 | 196 | |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | try { |
| 230 | 230 | $client = $this->httpClientService->newClient(); |
| 231 | 231 | $response = $client->get( |
| 232 | - $this->lookupServerUrl . '/users?search=' . urlencode($cloudId) . '&exactCloudId=1', |
|
| 232 | + $this->lookupServerUrl.'/users?search='.urlencode($cloudId).'&exactCloudId=1', |
|
| 233 | 233 | [ |
| 234 | 234 | 'timeout' => 10, |
| 235 | 235 | 'connect_timeout' => 3, |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | 'data' => $argument['data'], |
| 263 | 263 | 'type' => $argument['type'], |
| 264 | 264 | 'uid' => $argument['uid'], |
| 265 | - 'try' => (int)$argument['try'] + 1, |
|
| 265 | + 'try' => (int) $argument['try'] + 1, |
|
| 266 | 266 | 'lastRun' => time() |
| 267 | 267 | ] |
| 268 | 268 | ); |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | * @return bool |
| 276 | 276 | */ |
| 277 | 277 | protected function shouldRun(array $argument) { |
| 278 | - $lastRun = (int)$argument['lastRun']; |
|
| 278 | + $lastRun = (int) $argument['lastRun']; |
|
| 279 | 279 | return ((time() - $lastRun) > $this->interval); |
| 280 | 280 | } |
| 281 | 281 | |
@@ -64,12 +64,12 @@ discard block |
||
| 64 | 64 | $this->signer = $signer; |
| 65 | 65 | $this->jobList = $jobList; |
| 66 | 66 | |
| 67 | - if($config->getSystemValue('has_internet_connection', true) === false) { |
|
| 67 | + if ($config->getSystemValue('has_internet_connection', true) === false) { |
|
| 68 | 68 | return; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | $this->lookupServer = $config->getSystemValue('lookup_server', 'https://lookup.nextcloud.com'); |
| 72 | - if(!empty($this->lookupServer)) { |
|
| 72 | + if (!empty($this->lookupServer)) { |
|
| 73 | 73 | $this->lookupServer = rtrim($this->lookupServer, '/'); |
| 74 | 74 | $this->lookupServer .= '/users'; |
| 75 | 75 | } |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * @param IUser $user |
| 80 | 80 | */ |
| 81 | 81 | public function userUpdated(IUser $user) { |
| 82 | - if(empty($this->lookupServer)) { |
|
| 82 | + if (empty($this->lookupServer)) { |
|
| 83 | 83 | return; |
| 84 | 84 | } |
| 85 | 85 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | public function search($search, $limit, $offset, ISearchResult $searchResult) { |
| 64 | 64 | $isGlobalScaleEnabled = $this->config->getSystemValue('gs.enabled', false); |
| 65 | 65 | $isLookupServerEnabled = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'no') === 'yes'; |
| 66 | - $hasInternetConnection = (bool)$this->config->getSystemValue('has_internet_connection', true); |
|
| 66 | + $hasInternetConnection = (bool) $this->config->getSystemValue('has_internet_connection', true); |
|
| 67 | 67 | |
| 68 | 68 | // if case of Global Scale we always search the lookup server |
| 69 | 69 | if ((!$isLookupServerEnabled && !$isGlobalScaleEnabled) || !$hasInternetConnection) { |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | $lookupServerUrl = $this->config->getSystemValue('lookup_server', 'https://lookup.nextcloud.com'); |
| 74 | - if(empty($lookupServerUrl)) { |
|
| 74 | + if (empty($lookupServerUrl)) { |
|
| 75 | 75 | return false; |
| 76 | 76 | } |
| 77 | 77 | $lookupServerUrl = rtrim($lookupServerUrl, '/'); |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | try { |
| 81 | 81 | $client = $this->clientService->newClient(); |
| 82 | 82 | $response = $client->get( |
| 83 | - $lookupServerUrl . '/users?search=' . urlencode($search), |
|
| 83 | + $lookupServerUrl.'/users?search='.urlencode($search), |
|
| 84 | 84 | [ |
| 85 | 85 | 'timeout' => 10, |
| 86 | 86 | 'connect_timeout' => 3, |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | try { |
| 94 | 94 | $remote = $this->cloudIdManager->resolveCloudId($lookup['federationId'])->getRemote(); |
| 95 | 95 | } catch (\Exception $e) { |
| 96 | - $this->logger->error('Can not parse federated cloud ID "' . $lookup['federationId'] . '"'); |
|
| 96 | + $this->logger->error('Can not parse federated cloud ID "'.$lookup['federationId'].'"'); |
|
| 97 | 97 | $this->logger->error($e->getMessage()); |
| 98 | 98 | continue; |
| 99 | 99 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | continue; |
| 102 | 102 | } |
| 103 | 103 | $name = isset($lookup['name']['value']) ? $lookup['name']['value'] : ''; |
| 104 | - $label = empty($name) ? $lookup['federationId'] : $name . ' (' . $lookup['federationId'] . ')'; |
|
| 104 | + $label = empty($name) ? $lookup['federationId'] : $name.' ('.$lookup['federationId'].')'; |
|
| 105 | 105 | $result[] = [ |
| 106 | 106 | 'label' => $label, |
| 107 | 107 | 'value' => [ |