@@ -63,5 +63,5 @@ |
||
63 | 63 | * @return bool Whether $hash is a valid hash of $message |
64 | 64 | * @since 8.0.0 |
65 | 65 | */ |
66 | - public function verify(string $message, string $hash, &$newHash = null): bool ; |
|
66 | + public function verify(string $message, string $hash, &$newHash = null): bool; |
|
67 | 67 | } |
@@ -67,6 +67,6 @@ |
||
67 | 67 | $implements |= Backend::COUNT_USERS; |
68 | 68 | } |
69 | 69 | |
70 | - return (bool)($actions & $implements); |
|
70 | + return (bool) ($actions & $implements); |
|
71 | 71 | } |
72 | 72 | } |
@@ -62,6 +62,6 @@ |
||
62 | 62 | $implements |= GroupInterface::REMOVE_FROM_GOUP; |
63 | 63 | } |
64 | 64 | |
65 | - return (bool)($actions & $implements); |
|
65 | + return (bool) ($actions & $implements); |
|
66 | 66 | } |
67 | 67 | } |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | array $params, |
51 | 51 | array $elements, |
52 | 52 | bool $obfuscateParameters = false) { |
53 | - foreach($elements as $element) { |
|
54 | - if(!isset($params[$element])) { |
|
53 | + foreach ($elements as $element) { |
|
54 | + if (!isset($params[$element])) { |
|
55 | 55 | if ($obfuscateParameters) { |
56 | 56 | $this->logger->critical( |
57 | 57 | '$params["'.$element.'"] was missing.', |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | $replaceArray = []; |
74 | - foreach($elements as $element) { |
|
75 | - if($params[$element] instanceof \DateTime) { |
|
74 | + foreach ($elements as $element) { |
|
75 | + if ($params[$element] instanceof \DateTime) { |
|
76 | 76 | $params[$element] = $params[$element]->format('Y-m-d H:i:s'); |
77 | 77 | } |
78 | 78 | $replaceArray[] = $params[$element]; |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | public function getApps(string $filter = null): DataResponse { |
63 | 63 | $apps = (new OC_App())->listAllApps(); |
64 | 64 | $list = []; |
65 | - foreach($apps as $app) { |
|
65 | + foreach ($apps as $app) { |
|
66 | 66 | $list[] = $app['id']; |
67 | 67 | } |
68 | - if($filter){ |
|
69 | - switch($filter){ |
|
68 | + if ($filter) { |
|
69 | + switch ($filter) { |
|
70 | 70 | case 'enabled': |
71 | 71 | return new DataResponse(['apps' => \OC_App::getEnabledApps()]); |
72 | 72 | break; |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function getAppInfo(string $app): DataResponse { |
93 | 93 | $info = \OCP\App::getAppInfo($app); |
94 | - if(!is_null($info)) { |
|
94 | + if (!is_null($info)) { |
|
95 | 95 | return new DataResponse(OC_App::getAppInfo($app)); |
96 | 96 | } |
97 | 97 |
@@ -99,7 +99,7 @@ |
||
99 | 99 | $user = $this->userSession->getUser()->getUID(); |
100 | 100 | |
101 | 101 | $mounts = \OC_Mount_Config::getAbsoluteMountPoints($user); |
102 | - foreach($mounts as $mountPoint => $mount) { |
|
102 | + foreach ($mounts as $mountPoint => $mount) { |
|
103 | 103 | $entries[] = $this->formatMount($mountPoint, $mount); |
104 | 104 | } |
105 | 105 |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | // interpolate $message as defined in PSR-3 |
211 | 211 | $replace = []; |
212 | 212 | foreach ($context as $key => $val) { |
213 | - $replace['{' . $key . '}'] = $val; |
|
213 | + $replace['{'.$key.'}'] = $val; |
|
214 | 214 | } |
215 | 215 | $message = strtr($message, $replace); |
216 | 216 | |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | } |
318 | 318 | |
319 | 319 | public function getLogPath():string { |
320 | - if($this->logger instanceof IFileBased) { |
|
320 | + if ($this->logger instanceof IFileBased) { |
|
321 | 321 | return $this->logger->getLogFilePath(); |
322 | 322 | } |
323 | 323 | throw new \RuntimeException('Log implementation has no path'); |
@@ -121,13 +121,13 @@ discard block |
||
121 | 121 | public function search(string $search = '', string $itemType = null, int $page = 1, int $perPage = 200, $shareType = null, bool $lookup = true): DataResponse { |
122 | 122 | |
123 | 123 | // only search for string larger than a given threshold |
124 | - $threshold = (int)$this->config->getSystemValue('sharing.minSearchStringLength', 0); |
|
124 | + $threshold = (int) $this->config->getSystemValue('sharing.minSearchStringLength', 0); |
|
125 | 125 | if (strlen($search) < $threshold) { |
126 | 126 | return new DataResponse($this->result); |
127 | 127 | } |
128 | 128 | |
129 | 129 | // never return more than the max. number of results configured in the config.php |
130 | - $maxResults = (int)$this->config->getSystemValue('sharing.maxAutocompleteResults', 0); |
|
130 | + $maxResults = (int) $this->config->getSystemValue('sharing.maxAutocompleteResults', 0); |
|
131 | 131 | if ($maxResults > 0) { |
132 | 132 | $perPage = min($perPage, $maxResults); |
133 | 133 | } |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | list($result, $hasMoreResults) = $this->collaboratorSearch->search($search, $shareTypes, $lookup, $this->limit, $this->offset); |
183 | 183 | |
184 | 184 | // extra treatment for 'exact' subarray, with a single merge expected keys might be lost |
185 | - if(isset($result['exact'])) { |
|
185 | + if (isset($result['exact'])) { |
|
186 | 186 | $result['exact'] = array_merge($this->result['exact'], $result['exact']); |
187 | 187 | } |
188 | 188 | $this->result = array_merge($this->result, $result); |
@@ -226,12 +226,12 @@ discard block |
||
226 | 226 | */ |
227 | 227 | protected function getPaginationLink(int $page, array $params): string { |
228 | 228 | if ($this->isV2()) { |
229 | - $url = $this->urlGenerator->getAbsoluteURL('/ocs/v2.php/apps/files_sharing/api/v1/sharees') . '?'; |
|
229 | + $url = $this->urlGenerator->getAbsoluteURL('/ocs/v2.php/apps/files_sharing/api/v1/sharees').'?'; |
|
230 | 230 | } else { |
231 | - $url = $this->urlGenerator->getAbsoluteURL('/ocs/v1.php/apps/files_sharing/api/v1/sharees') . '?'; |
|
231 | + $url = $this->urlGenerator->getAbsoluteURL('/ocs/v1.php/apps/files_sharing/api/v1/sharees').'?'; |
|
232 | 232 | } |
233 | 233 | $params['page'] = $page + 1; |
234 | - return '<' . $url . http_build_query($params) . '>; rel="next"'; |
|
234 | + return '<'.$url.http_build_query($params).'>; rel="next"'; |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | /** |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | protected function run($argument) { |
155 | 155 | |
156 | 156 | $target = $argument['url']; |
157 | - $created = isset($argument['created']) ? (int)$argument['created'] : $this->timeFactory->getTime(); |
|
157 | + $created = isset($argument['created']) ? (int) $argument['created'] : $this->timeFactory->getTime(); |
|
158 | 158 | $currentTime = $this->timeFactory->getTime(); |
159 | 159 | $source = $this->urlGenerator->getAbsoluteURL('/'); |
160 | 160 | $source = rtrim($source, '/'); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | $endPoint = isset($endPoints['shared-secret']) ? $endPoints['shared-secret'] : $this->defaultEndPoint; |
173 | 173 | |
174 | 174 | // make sure that we have a well formated url |
175 | - $url = rtrim($target, '/') . '/' . trim($endPoint, '/'); |
|
175 | + $url = rtrim($target, '/').'/'.trim($endPoint, '/'); |
|
176 | 176 | |
177 | 177 | try { |
178 | 178 | $result = $this->httpClient->post( |
@@ -193,16 +193,16 @@ discard block |
||
193 | 193 | } catch (ClientException $e) { |
194 | 194 | $status = $e->getCode(); |
195 | 195 | if ($status === Http::STATUS_FORBIDDEN) { |
196 | - $this->logger->info($target . ' refused to ask for a shared secret.', ['app' => 'federation']); |
|
196 | + $this->logger->info($target.' refused to ask for a shared secret.', ['app' => 'federation']); |
|
197 | 197 | } else { |
198 | - $this->logger->info($target . ' responded with a ' . $status . ' containing: ' . $e->getMessage(), ['app' => 'federation']); |
|
198 | + $this->logger->info($target.' responded with a '.$status.' containing: '.$e->getMessage(), ['app' => 'federation']); |
|
199 | 199 | } |
200 | 200 | } catch (RequestException $e) { |
201 | 201 | $status = -1; // There is no status code if we could not connect |
202 | - $this->logger->info('Could not connect to ' . $target, ['app' => 'federation']); |
|
202 | + $this->logger->info('Could not connect to '.$target, ['app' => 'federation']); |
|
203 | 203 | } catch (RingException $e) { |
204 | 204 | $status = -1; // There is no status code if we could not connect |
205 | - $this->logger->info('Could not connect to ' . $target, ['app' => 'federation']); |
|
205 | + $this->logger->info('Could not connect to '.$target, ['app' => 'federation']); |
|
206 | 206 | } catch (\Exception $e) { |
207 | 207 | $status = Http::STATUS_INTERNAL_SERVER_ERROR; |
208 | 208 | $this->logger->logException($e, ['app' => 'federation']); |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | */ |
226 | 226 | protected function reAddJob(array $argument) { |
227 | 227 | $url = $argument['url']; |
228 | - $created = isset($argument['created']) ? (int)$argument['created'] : $this->timeFactory->getTime(); |
|
228 | + $created = isset($argument['created']) ? (int) $argument['created'] : $this->timeFactory->getTime(); |
|
229 | 229 | $token = $argument['token']; |
230 | 230 | |
231 | 231 | $this->jobList->add( |