Completed
Push — master ( 23768d...c7d9e5 )
by Blizzz
16:22
created
lib/base.php 1 patch
Spacing   +57 added lines, -57 removed lines patch added patch discarded remove patch
@@ -122,14 +122,14 @@  discard block
 block discarded – undo
122 122
 	 * the app path list is empty or contains an invalid path
123 123
 	 */
124 124
 	public static function initPaths() {
125
-		if(defined('PHPUNIT_CONFIG_DIR')) {
126
-			self::$configDir = OC::$SERVERROOT . '/' . PHPUNIT_CONFIG_DIR . '/';
127
-		} elseif(defined('PHPUNIT_RUN') and PHPUNIT_RUN and is_dir(OC::$SERVERROOT . '/tests/config/')) {
128
-			self::$configDir = OC::$SERVERROOT . '/tests/config/';
129
-		} elseif($dir = getenv('NEXTCLOUD_CONFIG_DIR')) {
130
-			self::$configDir = rtrim($dir, '/') . '/';
125
+		if (defined('PHPUNIT_CONFIG_DIR')) {
126
+			self::$configDir = OC::$SERVERROOT.'/'.PHPUNIT_CONFIG_DIR.'/';
127
+		} elseif (defined('PHPUNIT_RUN') and PHPUNIT_RUN and is_dir(OC::$SERVERROOT.'/tests/config/')) {
128
+			self::$configDir = OC::$SERVERROOT.'/tests/config/';
129
+		} elseif ($dir = getenv('NEXTCLOUD_CONFIG_DIR')) {
130
+			self::$configDir = rtrim($dir, '/').'/';
131 131
 		} else {
132
-			self::$configDir = OC::$SERVERROOT . '/config/';
132
+			self::$configDir = OC::$SERVERROOT.'/config/';
133 133
 		}
134 134
 		self::$config = new \OC\Config(self::$configDir);
135 135
 
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
 			//make sure suburi follows the same rules as scriptName
152 152
 			if (substr(OC::$SUBURI, -9) != 'index.php') {
153 153
 				if (substr(OC::$SUBURI, -1) != '/') {
154
-					OC::$SUBURI = OC::$SUBURI . '/';
154
+					OC::$SUBURI = OC::$SUBURI.'/';
155 155
 				}
156
-				OC::$SUBURI = OC::$SUBURI . 'index.php';
156
+				OC::$SUBURI = OC::$SUBURI.'index.php';
157 157
 			}
158 158
 		}
159 159
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
 				OC::$WEBROOT = substr($scriptName, 0, 0 - strlen(OC::$SUBURI));
166 166
 
167 167
 				if (OC::$WEBROOT != '' && OC::$WEBROOT[0] !== '/') {
168
-					OC::$WEBROOT = '/' . OC::$WEBROOT;
168
+					OC::$WEBROOT = '/'.OC::$WEBROOT;
169 169
 				}
170 170
 			} else {
171 171
 				// The scriptName is not ending with OC::$SUBURI
@@ -194,11 +194,11 @@  discard block
 block discarded – undo
194 194
 					OC::$APPSROOTS[] = $paths;
195 195
 				}
196 196
 			}
197
-		} elseif (file_exists(OC::$SERVERROOT . '/apps')) {
198
-			OC::$APPSROOTS[] = array('path' => OC::$SERVERROOT . '/apps', 'url' => '/apps', 'writable' => true);
199
-		} elseif (file_exists(OC::$SERVERROOT . '/../apps')) {
197
+		} elseif (file_exists(OC::$SERVERROOT.'/apps')) {
198
+			OC::$APPSROOTS[] = array('path' => OC::$SERVERROOT.'/apps', 'url' => '/apps', 'writable' => true);
199
+		} elseif (file_exists(OC::$SERVERROOT.'/../apps')) {
200 200
 			OC::$APPSROOTS[] = array(
201
-				'path' => rtrim(dirname(OC::$SERVERROOT), '/') . '/apps',
201
+				'path' => rtrim(dirname(OC::$SERVERROOT), '/').'/apps',
202 202
 				'url' => '/apps',
203 203
 				'writable' => true
204 204
 			);
@@ -228,8 +228,8 @@  discard block
 block discarded – undo
228 228
 		$l = \OC::$server->getL10N('lib');
229 229
 
230 230
 		// Create config if it does not already exist
231
-		$configFilePath = self::$configDir .'/config.php';
232
-		if(!file_exists($configFilePath)) {
231
+		$configFilePath = self::$configDir.'/config.php';
232
+		if (!file_exists($configFilePath)) {
233 233
 			@touch($configFilePath);
234 234
 		}
235 235
 
@@ -244,13 +244,13 @@  discard block
 block discarded – undo
244 244
 				echo $l->t('Cannot write into "config" directory!')."\n";
245 245
 				echo $l->t('This can usually be fixed by giving the webserver write access to the config directory')."\n";
246 246
 				echo "\n";
247
-				echo $l->t('See %s', [ $urlGenerator->linkToDocs('admin-dir_permissions') ])."\n";
247
+				echo $l->t('See %s', [$urlGenerator->linkToDocs('admin-dir_permissions')])."\n";
248 248
 				exit;
249 249
 			} else {
250 250
 				OC_Template::printErrorPage(
251 251
 					$l->t('Cannot write into "config" directory!'),
252 252
 					$l->t('This can usually be fixed by giving the webserver write access to the config directory. See %s',
253
-					 [ $urlGenerator->linkToDocs('admin-dir_permissions') ])
253
+					 [$urlGenerator->linkToDocs('admin-dir_permissions')])
254 254
 				);
255 255
 			}
256 256
 		}
@@ -265,8 +265,8 @@  discard block
 block discarded – undo
265 265
 			if (OC::$CLI) {
266 266
 				throw new Exception('Not installed');
267 267
 			} else {
268
-				$url = OC::$WEBROOT . '/index.php';
269
-				header('Location: ' . $url);
268
+				$url = OC::$WEBROOT.'/index.php';
269
+				header('Location: '.$url);
270 270
 			}
271 271
 			exit();
272 272
 		}
@@ -372,14 +372,14 @@  discard block
 block discarded – undo
372 372
 		$incompatibleShippedApps = [];
373 373
 		foreach ($incompatibleApps as $appInfo) {
374 374
 			if ($appManager->isShipped($appInfo['id'])) {
375
-				$incompatibleShippedApps[] = $appInfo['name'] . ' (' . $appInfo['id'] . ')';
375
+				$incompatibleShippedApps[] = $appInfo['name'].' ('.$appInfo['id'].')';
376 376
 			}
377 377
 		}
378 378
 
379 379
 		if (!empty($incompatibleShippedApps)) {
380 380
 			$l = \OC::$server->getL10N('core');
381 381
 			$hint = $l->t('The files of the app %$1s were not replaced correctly. Make sure it is a version compatible with the server.', [implode(', ', $incompatibleShippedApps)]);
382
-			throw new \OC\HintException('The files of the app ' . implode(', ', $incompatibleShippedApps) . ' were not replaced correctly. Make sure it is a version compatible with the server.', $hint);
382
+			throw new \OC\HintException('The files of the app '.implode(', ', $incompatibleShippedApps).' were not replaced correctly. Make sure it is a version compatible with the server.', $hint);
383 383
 		}
384 384
 
385 385
 		$tmpl->assign('appsToUpgrade', $appManager->getAppsNeedingUpgrade($ocVersion));
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 	}
391 391
 
392 392
 	public static function initSession() {
393
-		if(self::$server->getRequest()->getServerProtocol() === 'https') {
393
+		if (self::$server->getRequest()->getServerProtocol() === 'https') {
394 394
 			ini_set('session.cookie_secure', true);
395 395
 		}
396 396
 
@@ -398,7 +398,7 @@  discard block
 block discarded – undo
398 398
 		ini_set('session.cookie_httponly', 'true');
399 399
 
400 400
 		// set the cookie path to the Nextcloud directory
401
-		$cookie_path = OC::$WEBROOT ? : '/';
401
+		$cookie_path = OC::$WEBROOT ?: '/';
402 402
 		ini_set('session.cookie_path', $cookie_path);
403 403
 
404 404
 		// Let the session name be changed in the initSession Hook
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 		// session timeout
433 433
 		if ($session->exists('LAST_ACTIVITY') && (time() - $session->get('LAST_ACTIVITY') > $sessionLifeTime)) {
434 434
 			if (isset($_COOKIE[session_name()])) {
435
-				setcookie(session_name(), null, -1, self::$WEBROOT ? : '/');
435
+				setcookie(session_name(), null, -1, self::$WEBROOT ?: '/');
436 436
 			}
437 437
 			\OC::$server->getUserSession()->logout();
438 438
 		}
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 				continue;
455 455
 			}
456 456
 
457
-			$file = $appPath . '/appinfo/classpath.php';
457
+			$file = $appPath.'/appinfo/classpath.php';
458 458
 			if (file_exists($file)) {
459 459
 				require_once $file;
460 460
 			}
@@ -482,14 +482,14 @@  discard block
 block discarded – undo
482 482
 
483 483
 		// Append __Host to the cookie if it meets the requirements
484 484
 		$cookiePrefix = '';
485
-		if($cookieParams['secure'] === true && $cookieParams['path'] === '/') {
485
+		if ($cookieParams['secure'] === true && $cookieParams['path'] === '/') {
486 486
 			$cookiePrefix = '__Host-';
487 487
 		}
488 488
 
489
-		foreach($policies as $policy) {
489
+		foreach ($policies as $policy) {
490 490
 			header(
491 491
 				sprintf(
492
-					'Set-Cookie: %snc_sameSiteCookie%s=true; path=%s; httponly;' . $secureCookie . 'expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=%s',
492
+					'Set-Cookie: %snc_sameSiteCookie%s=true; path=%s; httponly;'.$secureCookie.'expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=%s',
493 493
 					$cookiePrefix,
494 494
 					$policy,
495 495
 					$cookieParams['path'],
@@ -520,31 +520,31 @@  discard block
 block discarded – undo
520 520
 			// OS X Finder
521 521
 			'/^WebDAVFS/',
522 522
 		];
523
-		if($request->isUserAgent($incompatibleUserAgents)) {
523
+		if ($request->isUserAgent($incompatibleUserAgents)) {
524 524
 			return;
525 525
 		}
526 526
 
527
-		if(count($_COOKIE) > 0) {
527
+		if (count($_COOKIE) > 0) {
528 528
 			$requestUri = $request->getScriptName();
529 529
 			$processingScript = explode('/', $requestUri);
530
-			$processingScript = $processingScript[count($processingScript)-1];
530
+			$processingScript = $processingScript[count($processingScript) - 1];
531 531
 
532 532
 			// index.php routes are handled in the middleware
533
-			if($processingScript === 'index.php') {
533
+			if ($processingScript === 'index.php') {
534 534
 				return;
535 535
 			}
536 536
 
537 537
 			// All other endpoints require the lax and the strict cookie
538
-			if(!$request->passesStrictCookieCheck()) {
538
+			if (!$request->passesStrictCookieCheck()) {
539 539
 				self::sendSameSiteCookies();
540 540
 				// Debug mode gets access to the resources without strict cookie
541 541
 				// due to the fact that the SabreDAV browser also lives there.
542
-				if(!\OC::$server->getConfig()->getSystemValue('debug', false)) {
542
+				if (!\OC::$server->getConfig()->getSystemValue('debug', false)) {
543 543
 					http_response_code(\OCP\AppFramework\Http::STATUS_SERVICE_UNAVAILABLE);
544 544
 					exit();
545 545
 				}
546 546
 			}
547
-		} elseif(!isset($_COOKIE['nc_sameSiteCookielax']) || !isset($_COOKIE['nc_sameSiteCookiestrict'])) {
547
+		} elseif (!isset($_COOKIE['nc_sameSiteCookielax']) || !isset($_COOKIE['nc_sameSiteCookiestrict'])) {
548 548
 			self::sendSameSiteCookies();
549 549
 		}
550 550
 	}
@@ -555,12 +555,12 @@  discard block
 block discarded – undo
555 555
 
556 556
 		// register autoloader
557 557
 		$loaderStart = microtime(true);
558
-		require_once __DIR__ . '/autoloader.php';
558
+		require_once __DIR__.'/autoloader.php';
559 559
 		self::$loader = new \OC\Autoloader([
560
-			OC::$SERVERROOT . '/lib/private/legacy',
560
+			OC::$SERVERROOT.'/lib/private/legacy',
561 561
 		]);
562 562
 		if (defined('PHPUNIT_RUN')) {
563
-			self::$loader->addValidRoot(OC::$SERVERROOT . '/tests');
563
+			self::$loader->addValidRoot(OC::$SERVERROOT.'/tests');
564 564
 		}
565 565
 		spl_autoload_register(array(self::$loader, 'load'));
566 566
 		$loaderEnd = microtime(true);
@@ -568,12 +568,12 @@  discard block
 block discarded – undo
568 568
 		self::$CLI = (php_sapi_name() == 'cli');
569 569
 
570 570
 		// Add default composer PSR-4 autoloader
571
-		self::$composerAutoloader = require_once OC::$SERVERROOT . '/lib/composer/autoload.php';
571
+		self::$composerAutoloader = require_once OC::$SERVERROOT.'/lib/composer/autoload.php';
572 572
 
573 573
 		try {
574 574
 			self::initPaths();
575 575
 			// setup 3rdparty autoloader
576
-			$vendorAutoLoad = OC::$SERVERROOT. '/3rdparty/autoload.php';
576
+			$vendorAutoLoad = OC::$SERVERROOT.'/3rdparty/autoload.php';
577 577
 			if (!file_exists($vendorAutoLoad)) {
578 578
 				throw new \RuntimeException('Composer autoloader not found, unable to continue. Check the folder "3rdparty". Running "git submodule update --init" will initialize the git submodule that handles the subfolder "3rdparty".');
579 579
 			}
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
 			if (!self::$CLI) {
584 584
 				$claimedProtocol = strtoupper($_SERVER['SERVER_PROTOCOL']);
585 585
 				$protocol = in_array($claimedProtocol, ['HTTP/1.0', 'HTTP/1.1', 'HTTP/2']) ? $claimedProtocol : 'HTTP/1.1';
586
-				header($protocol . ' ' . OC_Response::STATUS_SERVICE_UNAVAILABLE);
586
+				header($protocol.' '.OC_Response::STATUS_SERVICE_UNAVAILABLE);
587 587
 			}
588 588
 			// we can't use the template error page here, because this needs the
589 589
 			// DI container which isn't available yet
@@ -601,7 +601,7 @@  discard block
 block discarded – undo
601 601
 		@ini_set('display_errors', '0');
602 602
 		@ini_set('log_errors', '1');
603 603
 
604
-		if(!date_default_timezone_set('UTC')) {
604
+		if (!date_default_timezone_set('UTC')) {
605 605
 			throw new \RuntimeException('Could not set timezone to UTC');
606 606
 		};
607 607
 
@@ -655,11 +655,11 @@  discard block
 block discarded – undo
655 655
 					// Convert l10n string into regular string for usage in database
656 656
 					$staticErrors = [];
657 657
 					foreach ($errors as $error) {
658
-						echo $error['error'] . "\n";
659
-						echo $error['hint'] . "\n\n";
658
+						echo $error['error']."\n";
659
+						echo $error['hint']."\n\n";
660 660
 						$staticErrors[] = [
661
-							'error' => (string)$error['error'],
662
-							'hint' => (string)$error['hint'],
661
+							'error' => (string) $error['error'],
662
+							'hint' => (string) $error['hint'],
663 663
 						];
664 664
 					}
665 665
 
@@ -681,7 +681,7 @@  discard block
 block discarded – undo
681 681
 		}
682 682
 		//try to set the session lifetime
683 683
 		$sessionLifeTime = self::getSessionLifeTime();
684
-		@ini_set('gc_maxlifetime', (string)$sessionLifeTime);
684
+		@ini_set('gc_maxlifetime', (string) $sessionLifeTime);
685 685
 
686 686
 		$systemConfig = \OC::$server->getSystemConfig();
687 687
 
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
 		register_shutdown_function(array($lockProvider, 'releaseAll'));
728 728
 
729 729
 		// Check whether the sample configuration has been copied
730
-		if($systemConfig->getValue('copied_sample_config', false)) {
730
+		if ($systemConfig->getValue('copied_sample_config', false)) {
731 731
 			$l = \OC::$server->getL10N('lib');
732 732
 			header('HTTP/1.1 503 Service Temporarily Unavailable');
733 733
 			header('Status: 503 Service Temporarily Unavailable');
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
 		) {
754 754
 			// Allow access to CSS resources
755 755
 			$isScssRequest = false;
756
-			if(strpos($request->getPathInfo(), '/css/') === 0) {
756
+			if (strpos($request->getPathInfo(), '/css/') === 0) {
757 757
 				$isScssRequest = true;
758 758
 			}
759 759
 
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
 
790 790
 			// NOTE: This will be replaced to use OCP
791 791
 			$userSession = self::$server->getUserSession();
792
-			$userSession->listen('\OC\User', 'postLogin', function () use ($userSession) {
792
+			$userSession->listen('\OC\User', 'postLogin', function() use ($userSession) {
793 793
 				if (!defined('PHPUNIT_RUN')) {
794 794
 					// reset brute force delay for this IP address and username
795 795
 					$uid = \OC::$server->getUserSession()->getUser()->getUID();
@@ -809,7 +809,7 @@  discard block
 block discarded – undo
809 809
 				} catch (\Exception $e) {
810 810
 					// a GC exception should not prevent users from using OC,
811 811
 					// so log the exception
812
-					\OC::$server->getLogger()->warning('Exception when running cache gc: ' . $e->getMessage(), array('app' => 'core'));
812
+					\OC::$server->getLogger()->warning('Exception when running cache gc: '.$e->getMessage(), array('app' => 'core'));
813 813
 				}
814 814
 			});
815 815
 		}
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
 			/** @var \OCP\App\ManagerEvent $event */
826 826
 			$jobList = \OC::$server->getJobList();
827 827
 			$job = 'OC\\Settings\\RemoveOrphaned';
828
-			if(!($jobList->has($job, null))) {
828
+			if (!($jobList->has($job, null))) {
829 829
 				$jobList->add($job);
830 830
 			}
831 831
 		});
@@ -938,12 +938,12 @@  discard block
 block discarded – undo
938 938
 		// emergency app disabling
939 939
 		if ($requestPath === '/disableapp'
940 940
 			&& $request->getMethod() === 'POST'
941
-			&& ((array)$request->getParam('appid')) !== ''
941
+			&& ((array) $request->getParam('appid')) !== ''
942 942
 		) {
943 943
 			\OCP\JSON::callCheck();
944 944
 			\OCP\JSON::checkAdminUser();
945
-			$appIds = (array)$request->getParam('appid');
946
-			foreach($appIds as $appId) {
945
+			$appIds = (array) $request->getParam('appid');
946
+			foreach ($appIds as $appId) {
947 947
 				$appId = \OC_App::cleanAppId($appId);
948 948
 				\OC_App::disable($appId);
949 949
 			}
@@ -958,7 +958,7 @@  discard block
 block discarded – undo
958 958
 		if (!\OCP\Util::needUpgrade()
959 959
 			&& !$systemConfig->getValue('maintenance', false)) {
960 960
 			// For logged-in users: Load everything
961
-			if(\OC::$server->getUserSession()->isLoggedIn()) {
961
+			if (\OC::$server->getUserSession()->isLoggedIn()) {
962 962
 				OC_App::loadApps();
963 963
 			} else {
964 964
 				// For guests: Load only filesystem and logging
Please login to merge, or discard this patch.
core/Command/Upgrade.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.