@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | $client = $this->httpClientService->newClient(); |
231 | 231 | try { |
232 | 232 | $result = $client->get( |
233 | - $url . '/status.php', |
|
233 | + $url.'/status.php', |
|
234 | 234 | [ |
235 | 235 | 'timeout' => 3, |
236 | 236 | 'connect_timeout' => 3, |
@@ -286,6 +286,6 @@ discard block |
||
286 | 286 | |
287 | 287 | } |
288 | 288 | |
289 | - return 'https://' . $url; |
|
289 | + return 'https://'.$url; |
|
290 | 290 | } |
291 | 291 | } |
@@ -72,17 +72,17 @@ discard block |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | protected function getStorageConfigFromDBMount(array $mount) { |
75 | - $applicableUsers = array_filter($mount['applicable'], function ($applicable) { |
|
75 | + $applicableUsers = array_filter($mount['applicable'], function($applicable) { |
|
76 | 76 | return $applicable['type'] === DBConfigService::APPLICABLE_TYPE_USER; |
77 | 77 | }); |
78 | - $applicableUsers = array_map(function ($applicable) { |
|
78 | + $applicableUsers = array_map(function($applicable) { |
|
79 | 79 | return $applicable['value']; |
80 | 80 | }, $applicableUsers); |
81 | 81 | |
82 | - $applicableGroups = array_filter($mount['applicable'], function ($applicable) { |
|
82 | + $applicableGroups = array_filter($mount['applicable'], function($applicable) { |
|
83 | 83 | return $applicable['type'] === DBConfigService::APPLICABLE_TYPE_GROUP; |
84 | 84 | }); |
85 | - $applicableGroups = array_map(function ($applicable) { |
|
85 | + $applicableGroups = array_map(function($applicable) { |
|
86 | 86 | return $applicable['value']; |
87 | 87 | }, $applicableGroups); |
88 | 88 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | $mount['priority'] |
99 | 99 | ); |
100 | 100 | $config->setType($mount['type']); |
101 | - $config->setId((int)$mount['mount_id']); |
|
101 | + $config->setId((int) $mount['mount_id']); |
|
102 | 102 | return $config; |
103 | 103 | } catch (\UnexpectedValueException $e) { |
104 | 104 | // don't die if a storage backend doesn't exist |
@@ -126,11 +126,11 @@ discard block |
||
126 | 126 | protected function readConfig() { |
127 | 127 | $mounts = $this->readDBConfig(); |
128 | 128 | $configs = array_map([$this, 'getStorageConfigFromDBMount'], $mounts); |
129 | - $configs = array_filter($configs, function ($config) { |
|
129 | + $configs = array_filter($configs, function($config) { |
|
130 | 130 | return $config instanceof StorageConfig; |
131 | 131 | }); |
132 | 132 | |
133 | - $keys = array_map(function (StorageConfig $config) { |
|
133 | + $keys = array_map(function(StorageConfig $config) { |
|
134 | 134 | return $config->getId(); |
135 | 135 | }, $configs); |
136 | 136 | |
@@ -149,14 +149,14 @@ discard block |
||
149 | 149 | $mount = $this->dbConfig->getMountById($id); |
150 | 150 | |
151 | 151 | if (!is_array($mount)) { |
152 | - throw new NotFoundException('Storage with ID "' . $id . '" not found'); |
|
152 | + throw new NotFoundException('Storage with ID "'.$id.'" not found'); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | $config = $this->getStorageConfigFromDBMount($mount); |
156 | 156 | if ($this->isApplicable($config)) { |
157 | 157 | return $config; |
158 | 158 | } else { |
159 | - throw new NotFoundException('Storage with ID "' . $id . '" not found'); |
|
159 | + throw new NotFoundException('Storage with ID "'.$id.'" not found'); |
|
160 | 160 | } |
161 | 161 | } |
162 | 162 | |
@@ -379,13 +379,13 @@ discard block |
||
379 | 379 | $existingMount = $this->dbConfig->getMountById($id); |
380 | 380 | |
381 | 381 | if (!is_array($existingMount)) { |
382 | - throw new NotFoundException('Storage with ID "' . $id . '" not found while updating storage'); |
|
382 | + throw new NotFoundException('Storage with ID "'.$id.'" not found while updating storage'); |
|
383 | 383 | } |
384 | 384 | |
385 | 385 | $oldStorage = $this->getStorageConfigFromDBMount($existingMount); |
386 | 386 | |
387 | 387 | if ($oldStorage->getBackend() instanceof InvalidBackend) { |
388 | - throw new NotFoundException('Storage with id "' . $id . '" cannot be edited due to missing backend'); |
|
388 | + throw new NotFoundException('Storage with id "'.$id.'" cannot be edited due to missing backend'); |
|
389 | 389 | } |
390 | 390 | |
391 | 391 | $removedUsers = array_diff($oldStorage->getApplicableUsers(), $updatedStorage->getApplicableUsers()); |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | $existingMount = $this->dbConfig->getMountById($id); |
463 | 463 | |
464 | 464 | if (!is_array($existingMount)) { |
465 | - throw new NotFoundException('Storage with ID "' . $id . '" not found'); |
|
465 | + throw new NotFoundException('Storage with ID "'.$id.'" not found'); |
|
466 | 466 | } |
467 | 467 | |
468 | 468 | $this->dbConfig->removeMount($id); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | protected function execute(InputInterface $input, OutputInterface $output) { |
90 | 90 | |
91 | - if(Util::needUpgrade()) { |
|
91 | + if (Util::needUpgrade()) { |
|
92 | 92 | if (OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) { |
93 | 93 | // Prepend each line with a little timestamp |
94 | 94 | $timestampFormatter = new TimestampFormatter($this->config, $output->getFormatter()); |
@@ -110,10 +110,10 @@ discard block |
||
110 | 110 | if ($event instanceof GenericEvent) { |
111 | 111 | $message = $event->getSubject(); |
112 | 112 | if (OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) { |
113 | - $output->writeln(' Checking table ' . $message); |
|
113 | + $output->writeln(' Checking table '.$message); |
|
114 | 114 | } else { |
115 | 115 | if (strlen($message) > 60) { |
116 | - $message = substr($message, 0, 57) . '...'; |
|
116 | + $message = substr($message, 0, 57).'...'; |
|
117 | 117 | } |
118 | 118 | $progress->setMessage($message); |
119 | 119 | if ($event[0] === 1) { |
@@ -154,20 +154,20 @@ discard block |
||
154 | 154 | $output->writeln(''); |
155 | 155 | break; |
156 | 156 | case '\OC\Repair::step': |
157 | - if(OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) { |
|
158 | - $output->writeln('<info>Repair step: ' . $event->getArgument(0) . '</info>'); |
|
157 | + if (OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) { |
|
158 | + $output->writeln('<info>Repair step: '.$event->getArgument(0).'</info>'); |
|
159 | 159 | } |
160 | 160 | break; |
161 | 161 | case '\OC\Repair::info': |
162 | - if(OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) { |
|
163 | - $output->writeln('<info>Repair info: ' . $event->getArgument(0) . '</info>'); |
|
162 | + if (OutputInterface::VERBOSITY_NORMAL < $output->getVerbosity()) { |
|
163 | + $output->writeln('<info>Repair info: '.$event->getArgument(0).'</info>'); |
|
164 | 164 | } |
165 | 165 | break; |
166 | 166 | case '\OC\Repair::warning': |
167 | - $output->writeln('<error>Repair warning: ' . $event->getArgument(0) . '</error>'); |
|
167 | + $output->writeln('<error>Repair warning: '.$event->getArgument(0).'</error>'); |
|
168 | 168 | break; |
169 | 169 | case '\OC\Repair::error': |
170 | - $output->writeln('<error>Repair error: ' . $event->getArgument(0) . '</error>'); |
|
170 | + $output->writeln('<error>Repair error: '.$event->getArgument(0).'</error>'); |
|
171 | 171 | break; |
172 | 172 | } |
173 | 173 | }; |
@@ -183,17 +183,17 @@ discard block |
||
183 | 183 | $dispatcher->addListener('\OC\Repair::error', $repairListener); |
184 | 184 | |
185 | 185 | |
186 | - $updater->listen('\OC\Updater', 'maintenanceEnabled', function () use($output) { |
|
186 | + $updater->listen('\OC\Updater', 'maintenanceEnabled', function() use($output) { |
|
187 | 187 | $output->writeln('<info>Turned on maintenance mode</info>'); |
188 | 188 | }); |
189 | - $updater->listen('\OC\Updater', 'maintenanceDisabled', function () use($output) { |
|
189 | + $updater->listen('\OC\Updater', 'maintenanceDisabled', function() use($output) { |
|
190 | 190 | $output->writeln('<info>Turned off maintenance mode</info>'); |
191 | 191 | }); |
192 | - $updater->listen('\OC\Updater', 'maintenanceActive', function () use($output) { |
|
192 | + $updater->listen('\OC\Updater', 'maintenanceActive', function() use($output) { |
|
193 | 193 | $output->writeln('<info>Maintenance mode is kept active</info>'); |
194 | 194 | }); |
195 | 195 | $updater->listen('\OC\Updater', 'updateEnd', |
196 | - function ($success) use($output, $self) { |
|
196 | + function($success) use($output, $self) { |
|
197 | 197 | if ($success) { |
198 | 198 | $message = "<info>Update successful</info>"; |
199 | 199 | } else { |
@@ -201,58 +201,58 @@ discard block |
||
201 | 201 | } |
202 | 202 | $output->writeln($message); |
203 | 203 | }); |
204 | - $updater->listen('\OC\Updater', 'dbUpgradeBefore', function () use($output) { |
|
204 | + $updater->listen('\OC\Updater', 'dbUpgradeBefore', function() use($output) { |
|
205 | 205 | $output->writeln('<info>Updating database schema</info>'); |
206 | 206 | }); |
207 | - $updater->listen('\OC\Updater', 'dbUpgrade', function () use($output) { |
|
207 | + $updater->listen('\OC\Updater', 'dbUpgrade', function() use($output) { |
|
208 | 208 | $output->writeln('<info>Updated database</info>'); |
209 | 209 | }); |
210 | - $updater->listen('\OC\Updater', 'dbSimulateUpgradeBefore', function () use($output) { |
|
210 | + $updater->listen('\OC\Updater', 'dbSimulateUpgradeBefore', function() use($output) { |
|
211 | 211 | $output->writeln('<info>Checking whether the database schema can be updated (this can take a long time depending on the database size)</info>'); |
212 | 212 | }); |
213 | - $updater->listen('\OC\Updater', 'dbSimulateUpgrade', function () use($output) { |
|
213 | + $updater->listen('\OC\Updater', 'dbSimulateUpgrade', function() use($output) { |
|
214 | 214 | $output->writeln('<info>Checked database schema update</info>'); |
215 | 215 | }); |
216 | - $updater->listen('\OC\Updater', 'incompatibleAppDisabled', function ($app) use($output) { |
|
217 | - $output->writeln('<comment>Disabled incompatible app: ' . $app . '</comment>'); |
|
216 | + $updater->listen('\OC\Updater', 'incompatibleAppDisabled', function($app) use($output) { |
|
217 | + $output->writeln('<comment>Disabled incompatible app: '.$app.'</comment>'); |
|
218 | 218 | }); |
219 | - $updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function ($app) use($output) { |
|
220 | - $output->writeln('<info>Checking for update of app ' . $app . ' in appstore</info>'); |
|
219 | + $updater->listen('\OC\Updater', 'checkAppStoreAppBefore', function($app) use($output) { |
|
220 | + $output->writeln('<info>Checking for update of app '.$app.' in appstore</info>'); |
|
221 | 221 | }); |
222 | - $updater->listen('\OC\Updater', 'upgradeAppStoreApp', function ($app) use($output) { |
|
223 | - $output->writeln('<info>Update app ' . $app . ' from appstore</info>'); |
|
222 | + $updater->listen('\OC\Updater', 'upgradeAppStoreApp', function($app) use($output) { |
|
223 | + $output->writeln('<info>Update app '.$app.' from appstore</info>'); |
|
224 | 224 | }); |
225 | - $updater->listen('\OC\Updater', 'checkAppStoreApp', function ($app) use($output) { |
|
226 | - $output->writeln('<info>Checked for update of app "' . $app . '" in appstore </info>'); |
|
225 | + $updater->listen('\OC\Updater', 'checkAppStoreApp', function($app) use($output) { |
|
226 | + $output->writeln('<info>Checked for update of app "'.$app.'" in appstore </info>'); |
|
227 | 227 | }); |
228 | - $updater->listen('\OC\Updater', 'appUpgradeCheckBefore', function () use ($output) { |
|
228 | + $updater->listen('\OC\Updater', 'appUpgradeCheckBefore', function() use ($output) { |
|
229 | 229 | $output->writeln('<info>Checking updates of apps</info>'); |
230 | 230 | }); |
231 | - $updater->listen('\OC\Updater', 'appSimulateUpdate', function ($app) use ($output) { |
|
231 | + $updater->listen('\OC\Updater', 'appSimulateUpdate', function($app) use ($output) { |
|
232 | 232 | $output->writeln("<info>Checking whether the database schema for <$app> can be updated (this can take a long time depending on the database size)</info>"); |
233 | 233 | }); |
234 | - $updater->listen('\OC\Updater', 'appUpgradeCheck', function () use ($output) { |
|
234 | + $updater->listen('\OC\Updater', 'appUpgradeCheck', function() use ($output) { |
|
235 | 235 | $output->writeln('<info>Checked database schema update for apps</info>'); |
236 | 236 | }); |
237 | - $updater->listen('\OC\Updater', 'appUpgradeStarted', function ($app, $version) use ($output) { |
|
237 | + $updater->listen('\OC\Updater', 'appUpgradeStarted', function($app, $version) use ($output) { |
|
238 | 238 | $output->writeln("<info>Updating <$app> ...</info>"); |
239 | 239 | }); |
240 | - $updater->listen('\OC\Updater', 'appUpgrade', function ($app, $version) use ($output) { |
|
240 | + $updater->listen('\OC\Updater', 'appUpgrade', function($app, $version) use ($output) { |
|
241 | 241 | $output->writeln("<info>Updated <$app> to $version</info>"); |
242 | 242 | }); |
243 | - $updater->listen('\OC\Updater', 'failure', function ($message) use($output, $self) { |
|
243 | + $updater->listen('\OC\Updater', 'failure', function($message) use($output, $self) { |
|
244 | 244 | $output->writeln("<error>$message</error>"); |
245 | 245 | }); |
246 | - $updater->listen('\OC\Updater', 'setDebugLogLevel', function ($logLevel, $logLevelName) use($output) { |
|
246 | + $updater->listen('\OC\Updater', 'setDebugLogLevel', function($logLevel, $logLevelName) use($output) { |
|
247 | 247 | $output->writeln("<info>Set log level to debug</info>"); |
248 | 248 | }); |
249 | - $updater->listen('\OC\Updater', 'resetLogLevel', function ($logLevel, $logLevelName) use($output) { |
|
249 | + $updater->listen('\OC\Updater', 'resetLogLevel', function($logLevel, $logLevelName) use($output) { |
|
250 | 250 | $output->writeln("<info>Reset log level</info>"); |
251 | 251 | }); |
252 | - $updater->listen('\OC\Updater', 'startCheckCodeIntegrity', function () use($output) { |
|
252 | + $updater->listen('\OC\Updater', 'startCheckCodeIntegrity', function() use($output) { |
|
253 | 253 | $output->writeln("<info>Starting code integrity check...</info>"); |
254 | 254 | }); |
255 | - $updater->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function () use($output) { |
|
255 | + $updater->listen('\OC\Updater', 'finishedCheckCodeIntegrity', function() use($output) { |
|
256 | 256 | $output->writeln("<info>Finished code integrity check</info>"); |
257 | 257 | }); |
258 | 258 | |
@@ -260,12 +260,12 @@ discard block |
||
260 | 260 | |
261 | 261 | $this->postUpgradeCheck($input, $output); |
262 | 262 | |
263 | - if(!$success) { |
|
263 | + if (!$success) { |
|
264 | 264 | return self::ERROR_FAILURE; |
265 | 265 | } |
266 | 266 | |
267 | 267 | return self::ERROR_SUCCESS; |
268 | - } else if($this->config->getSystemValue('maintenance', false)) { |
|
268 | + } else if ($this->config->getSystemValue('maintenance', false)) { |
|
269 | 269 | //Possible scenario: Nextcloud core is updated but an app failed |
270 | 270 | $output->writeln('<warning>Nextcloud is in maintenance mode</warning>'); |
271 | 271 | $output->write('<comment>Maybe an upgrade is already in process. Please check the ' |
@@ -290,8 +290,8 @@ discard block |
||
290 | 290 | $trustedDomains = $this->config->getSystemValue('trusted_domains', array()); |
291 | 291 | if (empty($trustedDomains)) { |
292 | 292 | $output->write( |
293 | - '<warning>The setting "trusted_domains" could not be ' . |
|
294 | - 'set automatically by the upgrade script, ' . |
|
293 | + '<warning>The setting "trusted_domains" could not be '. |
|
294 | + 'set automatically by the upgrade script, '. |
|
295 | 295 | 'please set it manually</warning>' |
296 | 296 | ); |
297 | 297 | } |
@@ -201,7 +201,7 @@ |
||
201 | 201 | */ |
202 | 202 | public function update($id, array $scope) { |
203 | 203 | try { |
204 | - $token = $this->tokenProvider->getTokenById((string)$id); |
|
204 | + $token = $this->tokenProvider->getTokenById((string) $id); |
|
205 | 205 | if ($token->getUID() !== $this->uid) { |
206 | 206 | throw new InvalidTokenException('User mismatch'); |
207 | 207 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @param \OCP\IL10N $l10n |
47 | 47 | * @param Defaults $theme |
48 | 48 | */ |
49 | - public function __construct($template, $requestToken, $l10n, $theme ) { |
|
49 | + public function __construct($template, $requestToken, $l10n, $theme) { |
|
50 | 50 | $this->vars = array(); |
51 | 51 | $this->vars['requesttoken'] = $requestToken; |
52 | 52 | $this->l10n = $l10n; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | protected function getAppTemplateDirs($theme, $app, $serverRoot, $app_dir) { |
65 | 65 | // Check if the app is in the app folder or in the root |
66 | - if( file_exists($app_dir.'/templates/' )) { |
|
66 | + if (file_exists($app_dir.'/templates/')) { |
|
67 | 67 | return [ |
68 | 68 | $serverRoot.'/themes/'.$theme.'/apps/'.$app.'/templates/', |
69 | 69 | $app_dir.'/templates/', |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * |
99 | 99 | * If the key existed before, it will be overwritten |
100 | 100 | */ |
101 | - public function assign( $key, $value) { |
|
101 | + public function assign($key, $value) { |
|
102 | 102 | $this->vars[$key] = $value; |
103 | 103 | return true; |
104 | 104 | } |
@@ -113,12 +113,12 @@ discard block |
||
113 | 113 | * exists, the value will be appended. It can be accessed via |
114 | 114 | * $_[$key][$position] in the template. |
115 | 115 | */ |
116 | - public function append( $key, $value ) { |
|
117 | - if( array_key_exists( $key, $this->vars )) { |
|
116 | + public function append($key, $value) { |
|
117 | + if (array_key_exists($key, $this->vars)) { |
|
118 | 118 | $this->vars[$key][] = $value; |
119 | 119 | } |
120 | - else{ |
|
121 | - $this->vars[$key] = array( $value ); |
|
120 | + else { |
|
121 | + $this->vars[$key] = array($value); |
|
122 | 122 | } |
123 | 123 | } |
124 | 124 | |
@@ -130,10 +130,10 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function printPage() { |
132 | 132 | $data = $this->fetchPage(); |
133 | - if( $data === false ) { |
|
133 | + if ($data === false) { |
|
134 | 134 | return false; |
135 | 135 | } |
136 | - else{ |
|
136 | + else { |
|
137 | 137 | print $data; |
138 | 138 | return true; |
139 | 139 | } |
@@ -166,8 +166,8 @@ discard block |
||
166 | 166 | $l = $this->l10n; |
167 | 167 | $theme = $this->theme; |
168 | 168 | |
169 | - if(!is_null($additionalParams)) { |
|
170 | - $_ = array_merge( $additionalParams, $this->vars ); |
|
169 | + if (!is_null($additionalParams)) { |
|
170 | + $_ = array_merge($additionalParams, $this->vars); |
|
171 | 171 | foreach ($_ as $var => $value) { |
172 | 172 | ${$var} = $value; |
173 | 173 | } |
@@ -36,7 +36,7 @@ |
||
36 | 36 | $timezones = \DateTimeZone::listIdentifiers(); |
37 | 37 | |
38 | 38 | if ($search !== '') { |
39 | - $timezones = array_filter($timezones, function ($timezone) use ($search) { |
|
39 | + $timezones = array_filter($timezones, function($timezone) use ($search) { |
|
40 | 40 | return stripos($timezone, $search) !== false; |
41 | 41 | }); |
42 | 42 | } |
@@ -63,10 +63,10 @@ |
||
63 | 63 | */ |
64 | 64 | protected function execute(InputInterface $input, OutputInterface $output) { |
65 | 65 | $appid = $input->getArgument('appid'); |
66 | - $path = (string)$input->getOption('path'); |
|
66 | + $path = (string) $input->getOption('path'); |
|
67 | 67 | $result = $this->checker->verifyAppSignature($appid, $path); |
68 | 68 | $this->writeArrayInOutputFormat($input, $output, $result); |
69 | - if (count($result)>0){ |
|
69 | + if (count($result) > 0) { |
|
70 | 70 | return 1; |
71 | 71 | } |
72 | 72 | } |
@@ -58,13 +58,13 @@ |
||
58 | 58 | * @since 13.0.0 |
59 | 59 | */ |
60 | 60 | protected function getValidatedType($type) { |
61 | - $type = trim((string)$type); |
|
61 | + $type = trim((string) $type); |
|
62 | 62 | |
63 | - if($type === '') { |
|
63 | + if ($type === '') { |
|
64 | 64 | throw new \InvalidArgumentException('Type must not be empty'); |
65 | 65 | } |
66 | 66 | |
67 | - if($type === 'exact') { |
|
67 | + if ($type === 'exact') { |
|
68 | 68 | throw new \InvalidArgumentException('Provided type is a reserved word'); |
69 | 69 | } |
70 | 70 |
@@ -52,7 +52,7 @@ |
||
52 | 52 | */ |
53 | 53 | public function generate($name, $parameters = array(), $absolute = false) { |
54 | 54 | asort($parameters); |
55 | - $key = $this->context->getHost() . '#' . $this->context->getBaseUrl() . $name . sha1(json_encode($parameters)) . (int)$absolute; |
|
55 | + $key = $this->context->getHost().'#'.$this->context->getBaseUrl().$name.sha1(json_encode($parameters)).(int) $absolute; |
|
56 | 56 | $cachedKey = $this->cache->get($key); |
57 | 57 | if ($cachedKey) { |
58 | 58 | return $cachedKey; |