Passed
Push — master ( 3d0e0f...a65c00 )
by Morris
09:35 queued 10s
created
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 = $this->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.