Passed
Push — master ( 20b348...4d82a9 )
by Joas
14:00 queued 12s
created
lib/private/AppFramework/Bootstrap/Coordinator.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 			 * the \OCP\AppFramework\Bootstrap\IBootstrap interface
113 113
 			 */
114 114
 			$appNameSpace = App::buildAppNamespace($appId);
115
-			$applicationClassName = $appNameSpace . '\\AppInfo\\Application';
115
+			$applicationClassName = $appNameSpace.'\\AppInfo\\Application';
116 116
 			try {
117 117
 				if (class_exists($applicationClassName) && in_array(IBootstrap::class, class_implements($applicationClassName), true)) {
118 118
 					try {
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 					$application->register($this->registrationContext->for($appId));
127 127
 				}
128 128
 			} catch (Throwable $e) {
129
-				$this->logger->emergency('Error during app service registration: ' . $e->getMessage(), [
129
+				$this->logger->emergency('Error during app service registration: '.$e->getMessage(), [
130 130
 					'exception' => $e,
131 131
 					'app' => $appId,
132 132
 				]);
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 		$this->bootedApps[$appId] = true;
158 158
 
159 159
 		$appNameSpace = App::buildAppNamespace($appId);
160
-		$applicationClassName = $appNameSpace . '\\AppInfo\\Application';
160
+		$applicationClassName = $appNameSpace.'\\AppInfo\\Application';
161 161
 		if (!class_exists($applicationClassName)) {
162 162
 			// Nothing to boot
163 163
 			return;
@@ -178,11 +178,11 @@  discard block
 block discarded – undo
178 178
 				$application->boot($context);
179 179
 			}
180 180
 		} catch (QueryException $e) {
181
-			$this->logger->error("Could not boot $appId" . $e->getMessage(), [
181
+			$this->logger->error("Could not boot $appId".$e->getMessage(), [
182 182
 				'exception' => $e,
183 183
 			]);
184 184
 		} catch (Throwable $e) {
185
-			$this->logger->emergency("Could not boot $appId" . $e->getMessage(), [
185
+			$this->logger->emergency("Could not boot $appId".$e->getMessage(), [
186 186
 				'exception' => $e,
187 187
 			]);
188 188
 		}
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 
191 191
 	public function isBootable(string $appId) {
192 192
 		$appNameSpace = App::buildAppNamespace($appId);
193
-		$applicationClassName = $appNameSpace . '\\AppInfo\\Application';
193
+		$applicationClassName = $appNameSpace.'\\AppInfo\\Application';
194 194
 		return class_exists($applicationClassName) &&
195 195
 			in_array(IBootstrap::class, class_implements($applicationClassName), true);
196 196
 	}
Please login to merge, or discard this patch.
lib/private/legacy/OC_App.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
 				try {
139 139
 					self::loadApp($app);
140 140
 				} catch (\Throwable $e) {
141
-					\OC::$server->get(LoggerInterface::class)->emergency('Error during app loading: ' . $e->getMessage(), [
141
+					\OC::$server->get(LoggerInterface::class)->emergency('Error during app loading: '.$e->getMessage(), [
142 142
 						'exception' => $e,
143 143
 						'app' => $app,
144 144
 					]);
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 		$coordinator = \OC::$server->query(Coordinator::class);
171 171
 		$isBootable = $coordinator->isBootable($app);
172 172
 
173
-		$hasAppPhpFile = is_file($appPath . '/appinfo/app.php');
173
+		$hasAppPhpFile = is_file($appPath.'/appinfo/app.php');
174 174
 
175 175
 		if ($isBootable && $hasAppPhpFile) {
176 176
 			\OC::$server->getLogger()->error('/appinfo/app.php is not loaded when \OCP\AppFramework\Bootstrap\IBootstrap on the application class is used. Migrate everything from app.php to the Application class.', [
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 			\OC::$server->getLogger()->debug('/appinfo/app.php is deprecated, use \OCP\AppFramework\Bootstrap\IBootstrap on the application class instead.', [
181 181
 				'app' => $app,
182 182
 			]);
183
-			\OC::$server->getEventLogger()->start('load_app_' . $app, 'Load app: ' . $app);
183
+			\OC::$server->getEventLogger()->start('load_app_'.$app, 'Load app: '.$app);
184 184
 			try {
185 185
 				self::requireAppFile($app);
186 186
 			} catch (Throwable $ex) {
@@ -189,18 +189,18 @@  discard block
 block discarded – undo
189 189
 				}
190 190
 				if (!\OC::$server->getAppManager()->isShipped($app) && !self::isType($app, ['authentication'])) {
191 191
 					\OC::$server->getLogger()->logException($ex, [
192
-						'message' => "App $app threw an error during app.php load and will be disabled: " . $ex->getMessage(),
192
+						'message' => "App $app threw an error during app.php load and will be disabled: ".$ex->getMessage(),
193 193
 					]);
194 194
 
195 195
 					// Only disable apps which are not shipped and that are not authentication apps
196 196
 					\OC::$server->getAppManager()->disableApp($app, true);
197 197
 				} else {
198 198
 					\OC::$server->getLogger()->logException($ex, [
199
-						'message' => "App $app threw an error during app.php load: " . $ex->getMessage(),
199
+						'message' => "App $app threw an error during app.php load: ".$ex->getMessage(),
200 200
 					]);
201 201
 				}
202 202
 			}
203
-			\OC::$server->getEventLogger()->end('load_app_' . $app);
203
+			\OC::$server->getEventLogger()->end('load_app_'.$app);
204 204
 		}
205 205
 		$coordinator->bootApp($app);
206 206
 
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 	 * @param bool $force
268 268
 	 */
269 269
 	public static function registerAutoloading(string $app, string $path, bool $force = false) {
270
-		$key = $app . '-' . $path;
270
+		$key = $app.'-'.$path;
271 271
 		if (!$force && isset(self::$alreadyRegistered[$key])) {
272 272
 			return;
273 273
 		}
@@ -278,17 +278,17 @@  discard block
 block discarded – undo
278 278
 		$appNamespace = \OC\AppFramework\App::buildAppNamespace($app);
279 279
 		\OC::$server->registerNamespace($app, $appNamespace);
280 280
 
281
-		if (file_exists($path . '/composer/autoload.php')) {
282
-			require_once $path . '/composer/autoload.php';
281
+		if (file_exists($path.'/composer/autoload.php')) {
282
+			require_once $path.'/composer/autoload.php';
283 283
 		} else {
284
-			\OC::$composerAutoloader->addPsr4($appNamespace . '\\', $path . '/lib/', true);
284
+			\OC::$composerAutoloader->addPsr4($appNamespace.'\\', $path.'/lib/', true);
285 285
 			// Register on legacy autoloader
286 286
 			\OC::$loader->addValidRoot($path);
287 287
 		}
288 288
 
289 289
 		// Register Test namespace only when testing
290 290
 		if (defined('PHPUNIT_RUN') || defined('CLI_TEST_RUN')) {
291
-			\OC::$composerAutoloader->addPsr4($appNamespace . '\\Tests\\', $path . '/tests/', true);
291
+			\OC::$composerAutoloader->addPsr4($appNamespace.'\\Tests\\', $path.'/tests/', true);
292 292
 		}
293 293
 	}
294 294
 
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
 	 */
301 301
 	private static function requireAppFile(string $app) {
302 302
 		// encapsulated here to avoid variable scope conflicts
303
-		require_once $app . '/appinfo/app.php';
303
+		require_once $app.'/appinfo/app.php';
304 304
 	}
305 305
 
306 306
 	/**
@@ -393,8 +393,8 @@  discard block
 block discarded – undo
393 393
 		} else {
394 394
 			$apps = $appManager->getEnabledAppsForUser($user);
395 395
 		}
396
-		$apps = array_filter($apps, function ($app) {
397
-			return $app !== 'files';//we add this manually
396
+		$apps = array_filter($apps, function($app) {
397
+			return $app !== 'files'; //we add this manually
398 398
 		});
399 399
 		sort($apps);
400 400
 		array_unshift($apps, 'files');
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 
495 495
 		$possibleApps = [];
496 496
 		foreach (OC::$APPSROOTS as $dir) {
497
-			if (file_exists($dir['path'] . '/' . $appId)) {
497
+			if (file_exists($dir['path'].'/'.$appId)) {
498 498
 				$possibleApps[] = $dir;
499 499
 			}
500 500
 		}
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 		} else {
509 509
 			$versionToLoad = [];
510 510
 			foreach ($possibleApps as $possibleApp) {
511
-				$version = self::getAppVersionByPath($possibleApp['path'] . '/' . $appId);
511
+				$version = self::getAppVersionByPath($possibleApp['path'].'/'.$appId);
512 512
 				if (empty($versionToLoad) || version_compare($version, $versionToLoad['version'], '>')) {
513 513
 					$versionToLoad = [
514 514
 						'dir' => $possibleApp,
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 		}
539 539
 
540 540
 		if (($dir = self::findAppInDirectories($appId)) != false) {
541
-			return $dir['path'] . '/' . $appId;
541
+			return $dir['path'].'/'.$appId;
542 542
 		}
543 543
 		return false;
544 544
 	}
@@ -553,7 +553,7 @@  discard block
 block discarded – undo
553 553
 	 */
554 554
 	public static function getAppWebPath(string $appId) {
555 555
 		if (($dir = self::findAppInDirectories($appId)) != false) {
556
-			return OC::$WEBROOT . $dir['url'] . '/' . $appId;
556
+			return OC::$WEBROOT.$dir['url'].'/'.$appId;
557 557
 		}
558 558
 		return false;
559 559
 	}
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 	 * @return string
578 578
 	 */
579 579
 	public static function getAppVersionByPath(string $path): string {
580
-		$infoFile = $path . '/appinfo/info.xml';
580
+		$infoFile = $path.'/appinfo/info.xml';
581 581
 		$appData = \OC::$server->getAppManager()->getAppInfo($infoFile, true);
582 582
 		return isset($appData['version']) ? $appData['version'] : '';
583 583
 	}
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
 	 * @param string $page
678 678
 	 */
679 679
 	public static function registerAdmin(string $app, string $page) {
680
-		self::$adminForms[] = $app . '/' . $page . '.php';
680
+		self::$adminForms[] = $app.'/'.$page.'.php';
681 681
 	}
682 682
 
683 683
 	/**
@@ -686,7 +686,7 @@  discard block
 block discarded – undo
686 686
 	 * @param string $page
687 687
 	 */
688 688
 	public static function registerPersonal(string $app, string $page) {
689
-		self::$personalForms[] = $app . '/' . $page . '.php';
689
+		self::$personalForms[] = $app.'/'.$page.'.php';
690 690
 	}
691 691
 
692 692
 	/**
@@ -757,14 +757,14 @@  discard block
 block discarded – undo
757 757
 
758 758
 		foreach (OC::$APPSROOTS as $apps_dir) {
759 759
 			if (!is_readable($apps_dir['path'])) {
760
-				\OCP\Util::writeLog('core', 'unable to read app folder : ' . $apps_dir['path'], ILogger::WARN);
760
+				\OCP\Util::writeLog('core', 'unable to read app folder : '.$apps_dir['path'], ILogger::WARN);
761 761
 				continue;
762 762
 			}
763 763
 			$dh = opendir($apps_dir['path']);
764 764
 
765 765
 			if (is_resource($dh)) {
766 766
 				while (($file = readdir($dh)) !== false) {
767
-					if ($file[0] != '.' and is_dir($apps_dir['path'] . '/' . $file) and is_file($apps_dir['path'] . '/' . $file . '/appinfo/info.xml')) {
767
+					if ($file[0] != '.' and is_dir($apps_dir['path'].'/'.$file) and is_file($apps_dir['path'].'/'.$file.'/appinfo/info.xml')) {
768 768
 						$apps[] = $file;
769 769
 					}
770 770
 				}
@@ -798,12 +798,12 @@  discard block
 block discarded – undo
798 798
 			if (array_search($app, $blacklist) === false) {
799 799
 				$info = OC_App::getAppInfo($app, false, $langCode);
800 800
 				if (!is_array($info)) {
801
-					\OCP\Util::writeLog('core', 'Could not read app info file for app "' . $app . '"', ILogger::ERROR);
801
+					\OCP\Util::writeLog('core', 'Could not read app info file for app "'.$app.'"', ILogger::ERROR);
802 802
 					continue;
803 803
 				}
804 804
 
805 805
 				if (!isset($info['name'])) {
806
-					\OCP\Util::writeLog('core', 'App id "' . $app . '" has no name in appinfo', ILogger::ERROR);
806
+					\OCP\Util::writeLog('core', 'App id "'.$app.'" has no name in appinfo', ILogger::ERROR);
807 807
 					continue;
808 808
 				}
809 809
 
@@ -835,12 +835,12 @@  discard block
 block discarded – undo
835 835
 
836 836
 				$appPath = self::getAppPath($app);
837 837
 				if ($appPath !== false) {
838
-					$appIcon = $appPath . '/img/' . $app . '.svg';
838
+					$appIcon = $appPath.'/img/'.$app.'.svg';
839 839
 					if (file_exists($appIcon)) {
840
-						$info['preview'] = $urlGenerator->imagePath($app, $app . '.svg');
840
+						$info['preview'] = $urlGenerator->imagePath($app, $app.'.svg');
841 841
 						$info['previewAsIcon'] = true;
842 842
 					} else {
843
-						$appIcon = $appPath . '/img/app.svg';
843
+						$appIcon = $appPath.'/img/app.svg';
844 844
 						if (file_exists($appIcon)) {
845 845
 							$info['preview'] = $urlGenerator->imagePath($app, 'app.svg');
846 846
 							$info['previewAsIcon'] = true;
@@ -979,8 +979,8 @@  discard block
 block discarded – undo
979 979
 			return false;
980 980
 		}
981 981
 
982
-		if (is_file($appPath . '/appinfo/database.xml')) {
983
-			\OC::$server->getLogger()->error('The appinfo/database.xml file is not longer supported. Used in ' . $appId);
982
+		if (is_file($appPath.'/appinfo/database.xml')) {
983
+			\OC::$server->getLogger()->error('The appinfo/database.xml file is not longer supported. Used in '.$appId);
984 984
 			return false;
985 985
 		}
986 986
 
@@ -1017,10 +1017,10 @@  discard block
 block discarded – undo
1017 1017
 			\OC::$server->getConfig()->deleteAppValue($appId, 'ocsid');
1018 1018
 		}
1019 1019
 		foreach ($appData['remote'] as $name => $path) {
1020
-			\OC::$server->getConfig()->setAppValue('core', 'remote_' . $name, $appId . '/' . $path);
1020
+			\OC::$server->getConfig()->setAppValue('core', 'remote_'.$name, $appId.'/'.$path);
1021 1021
 		}
1022 1022
 		foreach ($appData['public'] as $name => $path) {
1023
-			\OC::$server->getConfig()->setAppValue('core', 'public_' . $name, $appId . '/' . $path);
1023
+			\OC::$server->getConfig()->setAppValue('core', 'public_'.$name, $appId.'/'.$path);
1024 1024
 		}
1025 1025
 
1026 1026
 		self::setAppTypes($appId);
@@ -1090,17 +1090,17 @@  discard block
 block discarded – undo
1090 1090
 	public static function getStorage(string $appId) {
1091 1091
 		if (\OC::$server->getAppManager()->isEnabledForUser($appId)) { //sanity check
1092 1092
 			if (\OC::$server->getUserSession()->isLoggedIn()) {
1093
-				$view = new \OC\Files\View('/' . OC_User::getUser());
1093
+				$view = new \OC\Files\View('/'.OC_User::getUser());
1094 1094
 				if (!$view->file_exists($appId)) {
1095 1095
 					$view->mkdir($appId);
1096 1096
 				}
1097
-				return new \OC\Files\View('/' . OC_User::getUser() . '/' . $appId);
1097
+				return new \OC\Files\View('/'.OC_User::getUser().'/'.$appId);
1098 1098
 			} else {
1099
-				\OCP\Util::writeLog('core', 'Can\'t get app storage, app ' . $appId . ', user not logged in', ILogger::ERROR);
1099
+				\OCP\Util::writeLog('core', 'Can\'t get app storage, app '.$appId.', user not logged in', ILogger::ERROR);
1100 1100
 				return false;
1101 1101
 			}
1102 1102
 		} else {
1103
-			\OCP\Util::writeLog('core', 'Can\'t get app storage, app ' . $appId . ' not enabled', ILogger::ERROR);
1103
+			\OCP\Util::writeLog('core', 'Can\'t get app storage, app '.$appId.' not enabled', ILogger::ERROR);
1104 1104
 			return false;
1105 1105
 		}
1106 1106
 	}
@@ -1137,7 +1137,7 @@  discard block
 block discarded – undo
1137 1137
 
1138 1138
 				if ($attributeLang === $similarLang) {
1139 1139
 					$similarLangFallback = $option['@value'];
1140
-				} elseif (strpos($attributeLang, $similarLang . '_') === 0) {
1140
+				} elseif (strpos($attributeLang, $similarLang.'_') === 0) {
1141 1141
 					if ($similarLangFallback === false) {
1142 1142
 						$similarLangFallback = $option['@value'];
1143 1143
 					}
Please login to merge, or discard this patch.