Passed
Push — master ( 223a91...782554 )
by Morris
11:37
created
lib/base.php 1 patch
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -128,14 +128,14 @@  discard block
 block discarded – undo
128 128
 	 * the app path list is empty or contains an invalid path
129 129
 	 */
130 130
 	public static function initPaths() {
131
-		if(defined('PHPUNIT_CONFIG_DIR')) {
132
-			self::$configDir = OC::$SERVERROOT . '/' . PHPUNIT_CONFIG_DIR . '/';
133
-		} elseif(defined('PHPUNIT_RUN') and PHPUNIT_RUN and is_dir(OC::$SERVERROOT . '/tests/config/')) {
134
-			self::$configDir = OC::$SERVERROOT . '/tests/config/';
135
-		} elseif($dir = getenv('NEXTCLOUD_CONFIG_DIR')) {
136
-			self::$configDir = rtrim($dir, '/') . '/';
131
+		if (defined('PHPUNIT_CONFIG_DIR')) {
132
+			self::$configDir = OC::$SERVERROOT.'/'.PHPUNIT_CONFIG_DIR.'/';
133
+		} elseif (defined('PHPUNIT_RUN') and PHPUNIT_RUN and is_dir(OC::$SERVERROOT.'/tests/config/')) {
134
+			self::$configDir = OC::$SERVERROOT.'/tests/config/';
135
+		} elseif ($dir = getenv('NEXTCLOUD_CONFIG_DIR')) {
136
+			self::$configDir = rtrim($dir, '/').'/';
137 137
 		} else {
138
-			self::$configDir = OC::$SERVERROOT . '/config/';
138
+			self::$configDir = OC::$SERVERROOT.'/config/';
139 139
 		}
140 140
 		self::$config = new \OC\Config(self::$configDir);
141 141
 
@@ -157,9 +157,9 @@  discard block
 block discarded – undo
157 157
 			//make sure suburi follows the same rules as scriptName
158 158
 			if (substr(OC::$SUBURI, -9) != 'index.php') {
159 159
 				if (substr(OC::$SUBURI, -1) != '/') {
160
-					OC::$SUBURI = OC::$SUBURI . '/';
160
+					OC::$SUBURI = OC::$SUBURI.'/';
161 161
 				}
162
-				OC::$SUBURI = OC::$SUBURI . 'index.php';
162
+				OC::$SUBURI = OC::$SUBURI.'index.php';
163 163
 			}
164 164
 		}
165 165
 
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 				OC::$WEBROOT = substr($scriptName, 0, 0 - strlen(OC::$SUBURI));
172 172
 
173 173
 				if (OC::$WEBROOT != '' && OC::$WEBROOT[0] !== '/') {
174
-					OC::$WEBROOT = '/' . OC::$WEBROOT;
174
+					OC::$WEBROOT = '/'.OC::$WEBROOT;
175 175
 				}
176 176
 			} else {
177 177
 				// The scriptName is not ending with OC::$SUBURI
@@ -200,11 +200,11 @@  discard block
 block discarded – undo
200 200
 					OC::$APPSROOTS[] = $paths;
201 201
 				}
202 202
 			}
203
-		} elseif (file_exists(OC::$SERVERROOT . '/apps')) {
204
-			OC::$APPSROOTS[] = array('path' => OC::$SERVERROOT . '/apps', 'url' => '/apps', 'writable' => true);
205
-		} elseif (file_exists(OC::$SERVERROOT . '/../apps')) {
203
+		} elseif (file_exists(OC::$SERVERROOT.'/apps')) {
204
+			OC::$APPSROOTS[] = array('path' => OC::$SERVERROOT.'/apps', 'url' => '/apps', 'writable' => true);
205
+		} elseif (file_exists(OC::$SERVERROOT.'/../apps')) {
206 206
 			OC::$APPSROOTS[] = array(
207
-				'path' => rtrim(dirname(OC::$SERVERROOT), '/') . '/apps',
207
+				'path' => rtrim(dirname(OC::$SERVERROOT), '/').'/apps',
208 208
 				'url' => '/apps',
209 209
 				'writable' => true
210 210
 			);
@@ -234,8 +234,8 @@  discard block
 block discarded – undo
234 234
 		$l = \OC::$server->getL10N('lib');
235 235
 
236 236
 		// Create config if it does not already exist
237
-		$configFilePath = self::$configDir .'/config.php';
238
-		if(!file_exists($configFilePath)) {
237
+		$configFilePath = self::$configDir.'/config.php';
238
+		if (!file_exists($configFilePath)) {
239 239
 			@touch($configFilePath);
240 240
 		}
241 241
 
@@ -249,18 +249,18 @@  discard block
 block discarded – undo
249 249
 			if (self::$CLI) {
250 250
 				echo $l->t('Cannot write into "config" directory!')."\n";
251 251
 				echo $l->t('This can usually be fixed by giving the webserver write access to the config directory')."\n";
252
-				echo $l->t('See %s', [ $urlGenerator->linkToDocs('admin-dir_permissions') ])."\n";
252
+				echo $l->t('See %s', [$urlGenerator->linkToDocs('admin-dir_permissions')])."\n";
253 253
 				echo "\n";
254 254
 				echo $l->t('Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it.')."\n";
255
-				echo $l->t('See %s', [ $urlGenerator->linkToDocs('admin-config') ])."\n";
255
+				echo $l->t('See %s', [$urlGenerator->linkToDocs('admin-config')])."\n";
256 256
 				exit;
257 257
 			} else {
258 258
 				OC_Template::printErrorPage(
259 259
 					$l->t('Cannot write into "config" directory!'),
260 260
 					$l->t('This can usually be fixed by giving the webserver write access to the config directory. See %s',
261
-					[ $urlGenerator->linkToDocs('admin-dir_permissions') ]) . '. '
261
+					[$urlGenerator->linkToDocs('admin-dir_permissions')]).'. '
262 262
 					. $l->t('Or, if you prefer to keep config.php file read only, set the option "config_is_read_only" to true in it. See %s',
263
-					[ $urlGenerator->linkToDocs('admin-config') ] ),
263
+					[$urlGenerator->linkToDocs('admin-config')]),
264 264
 					503
265 265
 				);
266 266
 			}
@@ -276,8 +276,8 @@  discard block
 block discarded – undo
276 276
 			if (OC::$CLI) {
277 277
 				throw new Exception('Not installed');
278 278
 			} else {
279
-				$url = OC::$WEBROOT . '/index.php';
280
-				header('Location: ' . $url);
279
+				$url = OC::$WEBROOT.'/index.php';
280
+				header('Location: '.$url);
281 281
 			}
282 282
 			exit();
283 283
 		}
@@ -382,14 +382,14 @@  discard block
 block discarded – undo
382 382
 		$incompatibleShippedApps = [];
383 383
 		foreach ($incompatibleApps as $appInfo) {
384 384
 			if ($appManager->isShipped($appInfo['id'])) {
385
-				$incompatibleShippedApps[] = $appInfo['name'] . ' (' . $appInfo['id'] . ')';
385
+				$incompatibleShippedApps[] = $appInfo['name'].' ('.$appInfo['id'].')';
386 386
 			}
387 387
 		}
388 388
 
389 389
 		if (!empty($incompatibleShippedApps)) {
390 390
 			$l = \OC::$server->getL10N('core');
391 391
 			$hint = $l->t('The files of the app %1$s were not replaced correctly. Make sure it is a version compatible with the server.', [implode(', ', $incompatibleShippedApps)]);
392
-			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);
392
+			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);
393 393
 		}
394 394
 
395 395
 		$tmpl->assign('appsToUpgrade', $appManager->getAppsNeedingUpgrade($ocVersion));
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 	}
401 401
 
402 402
 	public static function initSession() {
403
-		if(self::$server->getRequest()->getServerProtocol() === 'https') {
403
+		if (self::$server->getRequest()->getServerProtocol() === 'https') {
404 404
 			ini_set('session.cookie_secure', true);
405 405
 		}
406 406
 
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
 		ini_set('session.cookie_httponly', 'true');
409 409
 
410 410
 		// set the cookie path to the Nextcloud directory
411
-		$cookie_path = OC::$WEBROOT ? : '/';
411
+		$cookie_path = OC::$WEBROOT ?: '/';
412 412
 		ini_set('session.cookie_path', $cookie_path);
413 413
 
414 414
 		// Let the session name be changed in the initSession Hook
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
 		// session timeout
442 442
 		if ($session->exists('LAST_ACTIVITY') && (time() - $session->get('LAST_ACTIVITY') > $sessionLifeTime)) {
443 443
 			if (isset($_COOKIE[session_name()])) {
444
-				setcookie(session_name(), '', -1, self::$WEBROOT ? : '/');
444
+				setcookie(session_name(), '', -1, self::$WEBROOT ?: '/');
445 445
 			}
446 446
 			\OC::$server->getUserSession()->logout();
447 447
 		}
@@ -477,14 +477,14 @@  discard block
 block discarded – undo
477 477
 
478 478
 		// Append __Host to the cookie if it meets the requirements
479 479
 		$cookiePrefix = '';
480
-		if($cookieParams['secure'] === true && $cookieParams['path'] === '/') {
480
+		if ($cookieParams['secure'] === true && $cookieParams['path'] === '/') {
481 481
 			$cookiePrefix = '__Host-';
482 482
 		}
483 483
 
484
-		foreach($policies as $policy) {
484
+		foreach ($policies as $policy) {
485 485
 			header(
486 486
 				sprintf(
487
-					'Set-Cookie: %snc_sameSiteCookie%s=true; path=%s; httponly;' . $secureCookie . 'expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=%s',
487
+					'Set-Cookie: %snc_sameSiteCookie%s=true; path=%s; httponly;'.$secureCookie.'expires=Fri, 31-Dec-2100 23:59:59 GMT; SameSite=%s',
488 488
 					$cookiePrefix,
489 489
 					$policy,
490 490
 					$cookieParams['path'],
@@ -523,31 +523,31 @@  discard block
 block discarded – undo
523 523
 			];
524 524
 		}
525 525
 
526
-		if($request->isUserAgent($incompatibleUserAgents)) {
526
+		if ($request->isUserAgent($incompatibleUserAgents)) {
527 527
 			return;
528 528
 		}
529 529
 
530
-		if(count($_COOKIE) > 0) {
530
+		if (count($_COOKIE) > 0) {
531 531
 			$requestUri = $request->getScriptName();
532 532
 			$processingScript = explode('/', $requestUri);
533
-			$processingScript = $processingScript[count($processingScript)-1];
533
+			$processingScript = $processingScript[count($processingScript) - 1];
534 534
 
535 535
 			// index.php routes are handled in the middleware
536
-			if($processingScript === 'index.php') {
536
+			if ($processingScript === 'index.php') {
537 537
 				return;
538 538
 			}
539 539
 
540 540
 			// All other endpoints require the lax and the strict cookie
541
-			if(!$request->passesStrictCookieCheck()) {
541
+			if (!$request->passesStrictCookieCheck()) {
542 542
 				self::sendSameSiteCookies();
543 543
 				// Debug mode gets access to the resources without strict cookie
544 544
 				// due to the fact that the SabreDAV browser also lives there.
545
-				if(!\OC::$server->getConfig()->getSystemValue('debug', false)) {
545
+				if (!\OC::$server->getConfig()->getSystemValue('debug', false)) {
546 546
 					http_response_code(\OCP\AppFramework\Http::STATUS_SERVICE_UNAVAILABLE);
547 547
 					exit();
548 548
 				}
549 549
 			}
550
-		} elseif(!isset($_COOKIE['nc_sameSiteCookielax']) || !isset($_COOKIE['nc_sameSiteCookiestrict'])) {
550
+		} elseif (!isset($_COOKIE['nc_sameSiteCookielax']) || !isset($_COOKIE['nc_sameSiteCookiestrict'])) {
551 551
 			self::sendSameSiteCookies();
552 552
 		}
553 553
 	}
@@ -558,12 +558,12 @@  discard block
 block discarded – undo
558 558
 
559 559
 		// register autoloader
560 560
 		$loaderStart = microtime(true);
561
-		require_once __DIR__ . '/autoloader.php';
561
+		require_once __DIR__.'/autoloader.php';
562 562
 		self::$loader = new \OC\Autoloader([
563
-			OC::$SERVERROOT . '/lib/private/legacy',
563
+			OC::$SERVERROOT.'/lib/private/legacy',
564 564
 		]);
565 565
 		if (defined('PHPUNIT_RUN')) {
566
-			self::$loader->addValidRoot(OC::$SERVERROOT . '/tests');
566
+			self::$loader->addValidRoot(OC::$SERVERROOT.'/tests');
567 567
 		}
568 568
 		spl_autoload_register(array(self::$loader, 'load'));
569 569
 		$loaderEnd = microtime(true);
@@ -571,12 +571,12 @@  discard block
 block discarded – undo
571 571
 		self::$CLI = (php_sapi_name() == 'cli');
572 572
 
573 573
 		// Add default composer PSR-4 autoloader
574
-		self::$composerAutoloader = require_once OC::$SERVERROOT . '/lib/composer/autoload.php';
574
+		self::$composerAutoloader = require_once OC::$SERVERROOT.'/lib/composer/autoload.php';
575 575
 
576 576
 		try {
577 577
 			self::initPaths();
578 578
 			// setup 3rdparty autoloader
579
-			$vendorAutoLoad = OC::$SERVERROOT. '/3rdparty/autoload.php';
579
+			$vendorAutoLoad = OC::$SERVERROOT.'/3rdparty/autoload.php';
580 580
 			if (!file_exists($vendorAutoLoad)) {
581 581
 				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".');
582 582
 			}
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
 		@ini_set('display_errors', '0');
603 603
 		@ini_set('log_errors', '1');
604 604
 
605
-		if(!date_default_timezone_set('UTC')) {
605
+		if (!date_default_timezone_set('UTC')) {
606 606
 			throw new \RuntimeException('Could not set timezone to UTC');
607 607
 		}
608 608
 
@@ -656,11 +656,11 @@  discard block
 block discarded – undo
656 656
 					// Convert l10n string into regular string for usage in database
657 657
 					$staticErrors = [];
658 658
 					foreach ($errors as $error) {
659
-						echo $error['error'] . "\n";
660
-						echo $error['hint'] . "\n\n";
659
+						echo $error['error']."\n";
660
+						echo $error['hint']."\n\n";
661 661
 						$staticErrors[] = [
662
-							'error' => (string)$error['error'],
663
-							'hint' => (string)$error['hint'],
662
+							'error' => (string) $error['error'],
663
+							'hint' => (string) $error['hint'],
664 664
 						];
665 665
 					}
666 666
 
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
 		}
683 683
 		//try to set the session lifetime
684 684
 		$sessionLifeTime = self::getSessionLifeTime();
685
-		@ini_set('gc_maxlifetime', (string)$sessionLifeTime);
685
+		@ini_set('gc_maxlifetime', (string) $sessionLifeTime);
686 686
 
687 687
 		$systemConfig = \OC::$server->getSystemConfig();
688 688
 
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
 		register_shutdown_function(array($lockProvider, 'releaseAll'));
733 733
 
734 734
 		// Check whether the sample configuration has been copied
735
-		if($systemConfig->getValue('copied_sample_config', false)) {
735
+		if ($systemConfig->getValue('copied_sample_config', false)) {
736 736
 			$l = \OC::$server->getL10N('lib');
737 737
 			OC_Template::printErrorPage(
738 738
 				$l->t('Sample configuration detected'),
@@ -757,11 +757,11 @@  discard block
 block discarded – undo
757 757
 		) {
758 758
 			// Allow access to CSS resources
759 759
 			$isScssRequest = false;
760
-			if(strpos($request->getPathInfo(), '/css/') === 0) {
760
+			if (strpos($request->getPathInfo(), '/css/') === 0) {
761 761
 				$isScssRequest = true;
762 762
 			}
763 763
 
764
-			if(substr($request->getRequestUri(), -11) === '/status.php') {
764
+			if (substr($request->getRequestUri(), -11) === '/status.php') {
765 765
 				http_response_code(400);
766 766
 				header('Content-Type: application/json');
767 767
 				echo '{"error": "Trusted domain error.", "code": 15}';
@@ -799,7 +799,7 @@  discard block
 block discarded – undo
799 799
 
800 800
 			// NOTE: This will be replaced to use OCP
801 801
 			$userSession = self::$server->getUserSession();
802
-			$userSession->listen('\OC\User', 'postLogin', function () use ($userSession) {
802
+			$userSession->listen('\OC\User', 'postLogin', function() use ($userSession) {
803 803
 				if (!defined('PHPUNIT_RUN')) {
804 804
 					// reset brute force delay for this IP address and username
805 805
 					$uid = \OC::$server->getUserSession()->getUser()->getUID();
@@ -851,7 +851,7 @@  discard block
 block discarded – undo
851 851
 
852 852
 	private static function registerAppRestrictionsHooks() {
853 853
 		$groupManager = self::$server->query(\OCP\IGroupManager::class);
854
-		$groupManager->listen ('\OC\Group', 'postDelete', function (\OCP\IGroup $group) {
854
+		$groupManager->listen('\OC\Group', 'postDelete', function(\OCP\IGroup $group) {
855 855
 			$appManager = self::$server->getAppManager();
856 856
 			$apps = $appManager->getEnabledAppsForGroup($group);
857 857
 			foreach ($apps as $appId) {
@@ -865,7 +865,7 @@  discard block
 block discarded – undo
865 865
 				if (empty($restrictions)) {
866 866
 					$appManager->disableApp($appId);
867 867
 				}
868
-				else{
868
+				else {
869 869
 					$appManager->enableAppForGroups($appId, $restrictions);
870 870
 				}
871 871
 
@@ -961,12 +961,12 @@  discard block
 block discarded – undo
961 961
 		// emergency app disabling
962 962
 		if ($requestPath === '/disableapp'
963 963
 			&& $request->getMethod() === 'POST'
964
-			&& ((array)$request->getParam('appid')) !== ''
964
+			&& ((array) $request->getParam('appid')) !== ''
965 965
 		) {
966 966
 			\OC_JSON::callCheck();
967 967
 			\OC_JSON::checkAdminUser();
968
-			$appIds = (array)$request->getParam('appid');
969
-			foreach($appIds as $appId) {
968
+			$appIds = (array) $request->getParam('appid');
969
+			foreach ($appIds as $appId) {
970 970
 				$appId = \OC_App::cleanAppId($appId);
971 971
 				\OC::$server->getAppManager()->disableApp($appId);
972 972
 			}
@@ -981,7 +981,7 @@  discard block
 block discarded – undo
981 981
 		if (!\OCP\Util::needUpgrade()
982 982
 			&& !((bool) $systemConfig->getValue('maintenance', false))) {
983 983
 			// For logged-in users: Load everything
984
-			if(\OC::$server->getUserSession()->isLoggedIn()) {
984
+			if (\OC::$server->getUserSession()->isLoggedIn()) {
985 985
 				OC_App::loadApps();
986 986
 			} else {
987 987
 				// For guests: Load only filesystem and logging
Please login to merge, or discard this patch.
lib/private/App/AppManager.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -120,11 +120,11 @@  discard block
 block discarded – undo
120 120
 			$values = $this->appConfig->getValues(false, 'enabled');
121 121
 
122 122
 			$alwaysEnabledApps = $this->getAlwaysEnabledApps();
123
-			foreach($alwaysEnabledApps as $appId) {
123
+			foreach ($alwaysEnabledApps as $appId) {
124 124
 				$values[$appId] = 'yes';
125 125
 			}
126 126
 
127
-			$this->installedAppsCache = array_filter($values, function ($value) {
127
+			$this->installedAppsCache = array_filter($values, function($value) {
128 128
 				return $value !== 'no';
129 129
 			});
130 130
 			ksort($this->installedAppsCache);
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 	 */
150 150
 	public function getEnabledAppsForUser(IUser $user) {
151 151
 		$apps = $this->getInstalledAppsValues();
152
-		$appsForUser = array_filter($apps, function ($enabled) use ($user) {
152
+		$appsForUser = array_filter($apps, function($enabled) use ($user) {
153 153
 			return $this->checkAppForUser($enabled, $user);
154 154
 		});
155 155
 		return array_keys($appsForUser);
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	 */
162 162
 	public function getEnabledAppsForGroup(IGroup $group): array {
163 163
 		$apps = $this->getInstalledAppsValues();
164
-		$appsForGroups = array_filter($apps, function ($enabled) use ($group) {
164
+		$appsForGroups = array_filter($apps, function($enabled) use ($group) {
165 165
 			return $this->checkAppForGroups($enabled, $group);
166 166
 		});
167 167
 		return array_keys($appsForGroups);
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 		} elseif ($user === null) {
219 219
 			return false;
220 220
 		} else {
221
-			if(empty($enabled)){
221
+			if (empty($enabled)) {
222 222
 				return false;
223 223
 			}
224 224
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 
227 227
 			if (!is_array($groupIds)) {
228 228
 				$jsonError = json_last_error();
229
-				$this->logger->warning('AppManger::checkAppForUser - can\'t decode group IDs: ' . print_r($enabled, true) . ' - json error code: ' . $jsonError, ['app' => 'lib']);
229
+				$this->logger->warning('AppManger::checkAppForUser - can\'t decode group IDs: '.print_r($enabled, true).' - json error code: '.$jsonError, ['app' => 'lib']);
230 230
 				return false;
231 231
 			}
232 232
 
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 
260 260
 			if (!is_array($groupIds)) {
261 261
 				$jsonError = json_last_error();
262
-				$this->logger->warning('AppManger::checkAppForUser - can\'t decode group IDs: ' . print_r($enabled, true) . ' - json error code: ' . $jsonError, ['app' => 'lib']);
262
+				$this->logger->warning('AppManger::checkAppForUser - can\'t decode group IDs: '.print_r($enabled, true).' - json error code: '.$jsonError, ['app' => 'lib']);
263 263
 				return false;
264 264
 			}
265 265
 
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 			throw new \InvalidArgumentException("$appId can't be enabled for groups.");
332 332
 		}
333 333
 
334
-		$groupIds = array_map(function ($group) {
334
+		$groupIds = array_map(function($group) {
335 335
 			/** @var \OCP\IGroup $group */
336 336
 			return ($group instanceof IGroup)
337 337
 				? $group->getGID()
@@ -381,8 +381,8 @@  discard block
 block discarded – undo
381 381
 	 */
382 382
 	public function getAppPath($appId) {
383 383
 		$appPath = \OC_App::getAppPath($appId);
384
-		if($appPath === false) {
385
-			throw new AppPathNotFoundException('Could not find path for ' . $appId);
384
+		if ($appPath === false) {
385
+			throw new AppPathNotFoundException('Could not find path for '.$appId);
386 386
 		}
387 387
 		return $appPath;
388 388
 	}
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
 			} catch (AppPathNotFoundException $e) {
444 444
 				return null;
445 445
 			}
446
-			$file = $appPath . '/appinfo/info.xml';
446
+			$file = $appPath.'/appinfo/info.xml';
447 447
 		}
448 448
 
449 449
 		$parser = new InfoParser($this->memCacheFactory->createLocal('core.appinfo'));
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
 	}
462 462
 
463 463
 	public function getAppVersion(string $appId, bool $useCache = true): string {
464
-		if(!$useCache || !isset($this->appVersions[$appId])) {
464
+		if (!$useCache || !isset($this->appVersions[$appId])) {
465 465
 			$appInfo = \OC::$server->getAppManager()->getAppInfo($appId);
466 466
 			$this->appVersions[$appId] = ($appInfo !== null && isset($appInfo['version'])) ? $appInfo['version'] : '0';
467 467
 		}
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 	 */
512 512
 	private function loadShippedJson() {
513 513
 		if ($this->shippedApps === null) {
514
-			$shippedJson = \OC::$SERVERROOT . '/core/shipped.json';
514
+			$shippedJson = \OC::$SERVERROOT.'/core/shipped.json';
515 515
 			if (!file_exists($shippedJson)) {
516 516
 				throw new \Exception("File not found: $shippedJson");
517 517
 			}
Please login to merge, or discard this patch.