@@ -82,7 +82,7 @@ |
||
82 | 82 | ); |
83 | 83 | }); |
84 | 84 | |
85 | - $container->registerService('SettingsController', function (IAppContainer $c) { |
|
85 | + $container->registerService('SettingsController', function(IAppContainer $c) { |
|
86 | 86 | $server = $c->getServer(); |
87 | 87 | return new SettingsController( |
88 | 88 | $c->getAppName(), |
@@ -60,7 +60,7 @@ |
||
60 | 60 | $progress->start(); |
61 | 61 | $this->syncService->syncThemAll(function($url, $ex) use ($progress, $output) { |
62 | 62 | if ($ex instanceof \Exception) { |
63 | - $output->writeln("Error while syncing $url : " . $ex->getMessage()); |
|
63 | + $output->writeln("Error while syncing $url : ".$ex->getMessage()); |
|
64 | 64 | |
65 | 65 | } else { |
66 | 66 | $progress->advance(); |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | $client = $this->httpClientService->newClient(); |
222 | 222 | try { |
223 | 223 | $result = $client->get( |
224 | - $url . '/status.php', |
|
224 | + $url.'/status.php', |
|
225 | 225 | [ |
226 | 226 | 'timeout' => 3, |
227 | 227 | 'connect_timeout' => 3, |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | |
233 | 233 | } |
234 | 234 | } catch (\Exception $e) { |
235 | - $this->logger->debug('No Nextcloud server: ' . $e->getMessage()); |
|
235 | + $this->logger->debug('No Nextcloud server: '.$e->getMessage()); |
|
236 | 236 | return false; |
237 | 237 | } |
238 | 238 | |
@@ -273,6 +273,6 @@ discard block |
||
273 | 273 | |
274 | 274 | } |
275 | 275 | |
276 | - return 'https://' . $url; |
|
276 | + return 'https://'.$url; |
|
277 | 277 | } |
278 | 278 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * |
46 | 46 | * @package OCA\Federation\Backgroundjob |
47 | 47 | */ |
48 | -class GetSharedSecret extends Job{ |
|
48 | +class GetSharedSecret extends Job { |
|
49 | 49 | |
50 | 50 | /** @var IClient */ |
51 | 51 | private $httpClient; |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $result = null; |
146 | 146 | try { |
147 | 147 | $result = $this->httpClient->get( |
148 | - $target . $this->endPoint, |
|
148 | + $target.$this->endPoint, |
|
149 | 149 | [ |
150 | 150 | 'query' => |
151 | 151 | [ |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | } catch (ClientException $e) { |
163 | 163 | $status = $e->getCode(); |
164 | 164 | if ($status === Http::STATUS_FORBIDDEN) { |
165 | - $this->logger->info($target . ' refused to exchange a shared secret with you.', ['app' => 'federation']); |
|
165 | + $this->logger->info($target.' refused to exchange a shared secret with you.', ['app' => 'federation']); |
|
166 | 166 | } else { |
167 | 167 | $this->logger->logException($e, ['app' => 'federation']); |
168 | 168 | } |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | && $status !== Http::STATUS_FORBIDDEN |
178 | 178 | ) { |
179 | 179 | $this->retainJob = true; |
180 | - } else { |
|
180 | + } else { |
|
181 | 181 | // reset token if we received a valid response |
182 | 182 | $this->dbHandler->addToken($target, ''); |
183 | 183 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | ); |
193 | 193 | } else { |
194 | 194 | $this->logger->error( |
195 | - 'remote server "' . $target . '"" does not return a valid shared secret', |
|
195 | + 'remote server "'.$target.'"" does not return a valid shared secret', |
|
196 | 196 | ['app' => 'federation'] |
197 | 197 | ); |
198 | 198 | $this->trustedServers->setServerStatus($target, TrustedServers::STATUS_FAILURE); |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | |
145 | 145 | try { |
146 | 146 | $result = $this->httpClient->post( |
147 | - $target . $this->endPoint, |
|
147 | + $target.$this->endPoint, |
|
148 | 148 | [ |
149 | 149 | 'body' => [ |
150 | 150 | 'url' => $source, |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | } catch (ClientException $e) { |
161 | 161 | $status = $e->getCode(); |
162 | 162 | if ($status === Http::STATUS_FORBIDDEN) { |
163 | - $this->logger->info($target . ' refused to ask for a shared secret.', ['app' => 'federation']); |
|
163 | + $this->logger->info($target.' refused to ask for a shared secret.', ['app' => 'federation']); |
|
164 | 164 | } else { |
165 | 165 | $this->logger->logException($e, ['app' => 'federation']); |
166 | 166 | } |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | $result = $query->execute(); |
88 | 88 | |
89 | 89 | if ($result) { |
90 | - return (int)$this->connection->lastInsertId('*PREFIX*'.$this->dbTable); |
|
90 | + return (int) $this->connection->lastInsertId('*PREFIX*'.$this->dbTable); |
|
91 | 91 | } else { |
92 | - $message = 'Internal failure, Could not add trusted server: ' . $url; |
|
92 | + $message = 'Internal failure, Could not add trusted server: '.$url; |
|
93 | 93 | $message_t = $this->IL10N->t('Could not add server'); |
94 | 94 | throw new HintException($message, $message_t); |
95 | 95 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $result = $query->execute()->fetchAll(); |
125 | 125 | |
126 | 126 | if (empty($result)) { |
127 | - throw new \Exception('No Server found with ID: ' . $id); |
|
127 | + throw new \Exception('No Server found with ID: '.$id); |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | return $result[0]; |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $result = $query->execute()->fetch(); |
194 | 194 | |
195 | 195 | if (!isset($result['token'])) { |
196 | - throw new \Exception('No token found for: ' . $url); |
|
196 | + throw new \Exception('No token found for: '.$url); |
|
197 | 197 | } |
198 | 198 | |
199 | 199 | return $result['token']; |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | ->setParameter('url_hash', $hash); |
267 | 267 | |
268 | 268 | $result = $query->execute()->fetch(); |
269 | - return (int)$result['status']; |
|
269 | + return (int) $result['status']; |
|
270 | 270 | } |
271 | 271 | |
272 | 272 | /** |
@@ -37,7 +37,7 @@ |
||
37 | 37 | $ss = $app->getSyncService(); |
38 | 38 | $ss->syncThemAll(function($url, $ex) { |
39 | 39 | if ($ex instanceof \Exception) { |
40 | - \OC::$server->getLogger()->error("Error while syncing $url : " . $ex->getMessage(), ['app' => 'fed-sync']); |
|
40 | + \OC::$server->getLogger()->error("Error while syncing $url : ".$ex->getMessage(), ['app' => 'fed-sync']); |
|
41 | 41 | } |
42 | 42 | }); |
43 | 43 | } |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $principals = []; |
60 | 60 | |
61 | 61 | if ($prefixPath === self::PRINCIPAL_PREFIX) { |
62 | - foreach($this->groupManager->search('') as $user) { |
|
62 | + foreach ($this->groupManager->search('') as $user) { |
|
63 | 63 | $principals[] = $this->groupToPrincipal($user); |
64 | 64 | } |
65 | 65 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | */ |
193 | 193 | protected function userToPrincipal($user) { |
194 | 194 | $principal = [ |
195 | - 'uri' => 'principals/users/' . $user->getUID(), |
|
195 | + 'uri' => 'principals/users/'.$user->getUID(), |
|
196 | 196 | '{DAV:}displayname' => $user->getDisplayName(), |
197 | 197 | ]; |
198 | 198 |
@@ -47,8 +47,8 @@ discard block |
||
47 | 47 | static function xmlDeserialize(Reader $reader) { |
48 | 48 | |
49 | 49 | $elements = $reader->parseInnerTree([ |
50 | - '{' . Plugin::NS_OWNCLOUD. '}set' => 'Sabre\\Xml\\Element\\KeyValue', |
|
51 | - '{' . Plugin::NS_OWNCLOUD . '}remove' => 'Sabre\\Xml\\Element\\KeyValue', |
|
50 | + '{'.Plugin::NS_OWNCLOUD.'}set' => 'Sabre\\Xml\\Element\\KeyValue', |
|
51 | + '{'.Plugin::NS_OWNCLOUD.'}remove' => 'Sabre\\Xml\\Element\\KeyValue', |
|
52 | 52 | ]); |
53 | 53 | |
54 | 54 | $set = []; |
@@ -57,21 +57,21 @@ discard block |
||
57 | 57 | foreach ($elements as $elem) { |
58 | 58 | switch ($elem['name']) { |
59 | 59 | |
60 | - case '{' . Plugin::NS_OWNCLOUD . '}set' : |
|
60 | + case '{'.Plugin::NS_OWNCLOUD.'}set' : |
|
61 | 61 | $sharee = $elem['value']; |
62 | 62 | |
63 | - $sumElem = '{' . Plugin::NS_OWNCLOUD . '}summary'; |
|
64 | - $commonName = '{' . Plugin::NS_OWNCLOUD . '}common-name'; |
|
63 | + $sumElem = '{'.Plugin::NS_OWNCLOUD.'}summary'; |
|
64 | + $commonName = '{'.Plugin::NS_OWNCLOUD.'}common-name'; |
|
65 | 65 | |
66 | 66 | $set[] = [ |
67 | 67 | 'href' => $sharee['{DAV:}href'], |
68 | 68 | 'commonName' => isset($sharee[$commonName]) ? $sharee[$commonName] : null, |
69 | 69 | 'summary' => isset($sharee[$sumElem]) ? $sharee[$sumElem] : null, |
70 | - 'readOnly' => !array_key_exists('{' . Plugin::NS_OWNCLOUD . '}read-write', $sharee), |
|
70 | + 'readOnly' => !array_key_exists('{'.Plugin::NS_OWNCLOUD.'}read-write', $sharee), |
|
71 | 71 | ]; |
72 | 72 | break; |
73 | 73 | |
74 | - case '{' . Plugin::NS_OWNCLOUD . '}remove' : |
|
74 | + case '{'.Plugin::NS_OWNCLOUD.'}remove' : |
|
75 | 75 | $remove[] = $elem['value']['{DAV:}href']; |
76 | 76 | break; |
77 | 77 |