Completed
Pull Request — master (#3531)
by Lukas
11:13
created
lib/private/legacy/defaults.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 		$this->defaultLogoClaim = '';
66 66
 		$this->defaultMailHeaderColor = '#0082c9'; /* header color of mail notifications */
67 67
 
68
-		$themePath = OC::$SERVERROOT . '/themes/' . OC_Util::getTheme() . '/defaults.php';
68
+		$themePath = OC::$SERVERROOT.'/themes/'.OC_Util::getTheme().'/defaults.php';
69 69
 		if (file_exists($themePath)) {
70 70
 			// prevent defaults.php from printing output
71 71
 			ob_start();
@@ -239,9 +239,9 @@  discard block
 block discarded – undo
239 239
 		if ($this->themeExist('getShortFooter')) {
240 240
 			$footer = $this->theme->getShortFooter();
241 241
 		} else {
242
-			$footer = '<a href="'. $this->getBaseUrl() . '" target="_blank"' .
243
-				' rel="noreferrer">' .$this->getEntity() . '</a>'.
244
-				' – ' . $this->getSlogan();
242
+			$footer = '<a href="'.$this->getBaseUrl().'" target="_blank"'.
243
+				' rel="noreferrer">'.$this->getEntity().'</a>'.
244
+				' – '.$this->getSlogan();
245 245
 		}
246 246
 
247 247
 		return $footer;
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 		if ($this->themeExist('buildDocLinkToKey')) {
269 269
 			return $this->theme->buildDocLinkToKey($key);
270 270
 		}
271
-		return $this->getDocBaseUrl() . '/server/' . $this->defaultDocVersion . '/go.php?to=' . $key;
271
+		return $this->getDocBaseUrl().'/server/'.$this->defaultDocVersion.'/go.php?to='.$key;
272 272
 	}
273 273
 
274 274
 	/**
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 	 * @return array scss variables to overwrite
288 288
 	 */
289 289
 	public function getScssVariables() {
290
-		if($this->themeExist('getScssVariables')) {
290
+		if ($this->themeExist('getScssVariables')) {
291 291
 			return $this->theme->getScssVariables();
292 292
 		}
293 293
 		return [];
Please login to merge, or discard this patch.
lib/private/Template/SCSSCacher.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -90,24 +90,24 @@  discard block
 block discarded – undo
90 90
 	 * @return boolean
91 91
 	 */
92 92
 	public function process($root, $file, $app) {
93
-		$path = explode('/', $root . '/' . $file);
93
+		$path = explode('/', $root.'/'.$file);
94 94
 
95 95
 		$fileNameSCSS = array_pop($path);
96 96
 		$fileNameCSS = str_replace('.scss', '.css', $fileNameSCSS);
97 97
 
98 98
 		$path = implode('/', $path);
99 99
 
100
-		$webDir = substr($path, strlen($this->serverRoot)+1);
100
+		$webDir = substr($path, strlen($this->serverRoot) + 1);
101 101
 
102 102
 		try {
103 103
 			$folder = $this->appData->getFolder($app);
104
-		} catch(NotFoundException $e) {
104
+		} catch (NotFoundException $e) {
105 105
 			// creating css appdata folder
106 106
 			$folder = $this->appData->newFolder($app);
107 107
 		}
108 108
 
109 109
 
110
-		if(!$this->variablesChanged() && $this->isCached($fileNameCSS, $folder)) {
110
+		if (!$this->variablesChanged() && $this->isCached($fileNameCSS, $folder)) {
111 111
 			return true;
112 112
 		}
113 113
 		return $this->cache($path, $fileNameCSS, $fileNameSCSS, $folder, $webDir);
@@ -133,13 +133,13 @@  discard block
 block discarded – undo
133 133
 		try {
134 134
 			$cachedFile = $folder->getFile($fileNameCSS);
135 135
 			if ($cachedFile->getSize() > 0) {
136
-				$depFileName = $fileNameCSS . '.deps';
137
-				$deps = $this->depsCache->get($folder->getName() . '-' . $depFileName);
136
+				$depFileName = $fileNameCSS.'.deps';
137
+				$deps = $this->depsCache->get($folder->getName().'-'.$depFileName);
138 138
 				if ($deps === null) {
139 139
 					$depFile = $folder->getFile($depFileName);
140 140
 					$deps = $depFile->getContent();
141 141
 					//Set to memcache for next run
142
-					$this->depsCache->set($folder->getName() . '-' . $depFileName, $deps);
142
+					$this->depsCache->set($folder->getName().'-'.$depFileName, $deps);
143 143
 				}
144 144
 				$deps = json_decode($deps, true);
145 145
 
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 				}
151 151
 			}
152 152
 			return true;
153
-		} catch(NotFoundException $e) {
153
+		} catch (NotFoundException $e) {
154 154
 			return false;
155 155
 		}
156 156
 	}
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
 	 */
162 162
 	private function variablesChanged() {
163 163
 		$injectedVariables = $this->getInjectedVariables();
164
-		if($this->config->getAppValue('core', 'scss.variables') !== md5($injectedVariables)) {
164
+		if ($this->config->getAppValue('core', 'scss.variables') !== md5($injectedVariables)) {
165 165
 			$this->resetCache();
166 166
 			$this->config->setAppValue('core', 'scss.variables', md5($injectedVariables));
167 167
 			return true;
@@ -182,9 +182,9 @@  discard block
 block discarded – undo
182 182
 		$scss = new Compiler();
183 183
 		$scss->setImportPaths([
184 184
 			$path,
185
-			\OC::$SERVERROOT . '/core/css/',
185
+			\OC::$SERVERROOT.'/core/css/',
186 186
 		]);
187
-		if($this->config->getSystemValue('debug')) {
187
+		if ($this->config->getSystemValue('debug')) {
188 188
 			// Debug mode
189 189
 			$scss->setFormatter(Expanded::class);
190 190
 			$scss->setLineNumberStyle(Compiler::LINE_COMMENTS);
@@ -195,11 +195,11 @@  discard block
 block discarded – undo
195 195
 
196 196
 		try {
197 197
 			$cachedfile = $folder->getFile($fileNameCSS);
198
-		} catch(NotFoundException $e) {
198
+		} catch (NotFoundException $e) {
199 199
 			$cachedfile = $folder->newFile($fileNameCSS);
200 200
 		}
201 201
 
202
-		$depFileName = $fileNameCSS . '.deps';
202
+		$depFileName = $fileNameCSS.'.deps';
203 203
 		try {
204 204
 			$depFile = $folder->getFile($depFileName);
205 205
 		} catch (NotFoundException $e) {
@@ -209,10 +209,10 @@  discard block
 block discarded – undo
209 209
 		// Compile
210 210
 		try {
211 211
 			$compiledScss = $scss->compile(
212
-				'@import "variables.scss";' .
213
-				$this->getInjectedVariables() .
212
+				'@import "variables.scss";'.
213
+				$this->getInjectedVariables().
214 214
 				'@import "'.$fileNameSCSS.'";');
215
-		} catch(ParserException $e) {
215
+		} catch (ParserException $e) {
216 216
 			$this->logger->error($e, ['app' => 'core']);
217 217
 			return false;
218 218
 		}
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 			$depFile->putContent(json_encode($scss->getParsedFiles()));
223 223
 			$this->logger->debug($webDir.'/'.$fileNameSCSS.' compiled and successfully cached', ['app' => 'core']);
224 224
 			return true;
225
-		} catch(NotPermittedException $e) {
225
+		} catch (NotPermittedException $e) {
226 226
 			return false;
227 227
 		}
228 228
 	}
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 	 */
234 234
 	private function resetCache() {
235 235
 		$appDirectory = $this->appData->getDirectoryListing();
236
-		if(empty($appDirectory)){
236
+		if (empty($appDirectory)) {
237 237
 			return;
238 238
 		}
239 239
 		foreach ($appDirectory as $folder) {
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 	private function getInjectedVariables() {
252 252
 		$variables = '';
253 253
 		foreach ($this->defaults->getScssVariables() as $key => $value) {
254
-			$variables .= '$' . $key . ': ' . $value . ';';
254
+			$variables .= '$'.$key.': '.$value.';';
255 255
 		}
256 256
 		return $variables;
257 257
 	}
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 	private function rebaseUrls($css, $webDir) {
266 266
 		$re = '/url\([\'"]([\.\w?=\/-]*)[\'"]\)/x';
267 267
 		// OC\Route\Router:75
268
-		if(($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true')) {
268
+		if (($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true')) {
269 269
 			$subst = 'url(\'../../'.$webDir.'/$1\')';	
270 270
 		} else {
271 271
 			$subst = 'url(\'../../../'.$webDir.'/$1\')';
Please login to merge, or discard this patch.
apps/theming/lib/Controller/ThemingController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -333,8 +333,8 @@  discard block
 block discarded – undo
333 333
 		 * We cannot rely on automatic caching done by \OC_Util::addStyle,
334 334
 		 * since we need to add the cacheBuster value to the url
335 335
 		 */
336
-		$cssCached = $this->scssCacher->process(\OC::$SERVERROOT, $appPath . '/css/theming.scss', 'theming');
337
-		if(!$cssCached) {
336
+		$cssCached = $this->scssCacher->process(\OC::$SERVERROOT, $appPath.'/css/theming.scss', 'theming');
337
+		if (!$cssCached) {
338 338
 			return new NotFoundResponse();
339 339
 		}
340 340
 
@@ -363,12 +363,12 @@  discard block
 block discarded – undo
363 363
 		$cacheBusterValue = $this->config->getAppValue('theming', 'cachebuster', '0');
364 364
 		$responseJS = '(function() {
365 365
 	OCA.Theming = {
366
-		name: ' . json_encode($this->themingDefaults->getName()) . ',
367
-		url: ' . json_encode($this->themingDefaults->getBaseUrl()) . ',
368
-		slogan: ' . json_encode($this->themingDefaults->getSlogan()) . ',
369
-		color: ' . json_encode($this->themingDefaults->getMailHeaderColor()) . ',
370
-		inverted: ' . json_encode($this->util->invertTextColor($this->themingDefaults->getMailHeaderColor())) . ',
371
-		cacheBuster: ' . json_encode($cacheBusterValue) . '
366
+		name: ' . json_encode($this->themingDefaults->getName()).',
367
+		url: ' . json_encode($this->themingDefaults->getBaseUrl()).',
368
+		slogan: ' . json_encode($this->themingDefaults->getSlogan()).',
369
+		color: ' . json_encode($this->themingDefaults->getMailHeaderColor()).',
370
+		inverted: ' . json_encode($this->util->invertTextColor($this->themingDefaults->getMailHeaderColor())).',
371
+		cacheBuster: ' . json_encode($cacheBusterValue).'
372 372
 	};
373 373
 })();';
374 374
 		$response = new DataDownloadResponse($responseJS, 'javascript', 'text/javascript');
Please login to merge, or discard this patch.
apps/theming/lib/ThemingDefaults.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -112,9 +112,9 @@  discard block
 block discarded – undo
112 112
 
113 113
 	public function getShortFooter() {
114 114
 		$slogan = $this->getSlogan();
115
-		$footer = '<a href="'. $this->getBaseUrl() . '" target="_blank"' .
116
-			' rel="noreferrer">' .$this->getEntity() . '</a>'.
117
-			($slogan !== '' ? ' – ' . $slogan : '');
115
+		$footer = '<a href="'.$this->getBaseUrl().'" target="_blank"'.
116
+			' rel="noreferrer">'.$this->getEntity().'</a>'.
117
+			($slogan !== '' ? ' – '.$slogan : '');
118 118
 
119 119
 		return $footer;
120 120
 	}
@@ -140,8 +140,8 @@  discard block
 block discarded – undo
140 140
 			$file = null;
141 141
 		}
142 142
 		$logo = $this->config->getAppValue('theming', 'logoMime', false);
143
-		if(!$logo || $file === null) {
144
-			return $this->urlGenerator->imagePath('core','logo.svg');
143
+		if (!$logo || $file === null) {
144
+			return $this->urlGenerator->imagePath('core', 'logo.svg');
145 145
 		} else {
146 146
 			return $this->urlGenerator->linkToRoute('theming.Theming.getLogo');
147 147
 		}
@@ -159,8 +159,8 @@  discard block
 block discarded – undo
159 159
 			$file = null;
160 160
 		}
161 161
 		$backgroundLogo = $this->config->getAppValue('theming', 'backgroundMime', false);
162
-		if(!$backgroundLogo || $file === null) {
163
-			return $this->urlGenerator->imagePath('core','background.jpg');
162
+		if (!$backgroundLogo || $file === null) {
163
+			return $this->urlGenerator->imagePath('core', 'background.jpg');
164 164
 		} else {
165 165
 			return $this->urlGenerator->linkToRoute('theming.Theming.getLoginBackground');
166 166
 		}
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 		}
178 178
 
179 179
 		$variables = [
180
-			'theming-cachebuster' => "'" . $this->config->getAppValue('theming', 'cachebuster', '0') . "'",
180
+			'theming-cachebuster' => "'".$this->config->getAppValue('theming', 'cachebuster', '0')."'",
181 181
 		];
182 182
 
183 183
 		$variables['image-logo'] = "'../../".$this->getLogo()."'";
@@ -204,11 +204,11 @@  discard block
 block discarded – undo
204 204
 	 */
205 205
 	public function shouldReplaceIcons() {
206 206
 		$cache = $this->cacheFactory->create('theming');
207
-		if($value = $cache->get('shouldReplaceIcons')) {
208
-			return (bool)$value;
207
+		if ($value = $cache->get('shouldReplaceIcons')) {
208
+			return (bool) $value;
209 209
 		}
210 210
 		$value = false;
211
-		if(extension_loaded('imagick')) {
211
+		if (extension_loaded('imagick')) {
212 212
 			$checkImagick = new \Imagick();
213 213
 			if (count($checkImagick->queryFormats('SVG')) >= 1) {
214 214
 				$value = true;
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 	 */
225 225
 	private function increaseCacheBuster() {
226 226
 		$cacheBusterKey = $this->config->getAppValue('theming', 'cachebuster', '0');
227
-		$this->config->setAppValue('theming', 'cachebuster', (int)$cacheBusterKey+1);
227
+		$this->config->setAppValue('theming', 'cachebuster', (int) $cacheBusterKey + 1);
228 228
 		$this->cacheFactory->create('theming')->clear('getScssVariables');
229 229
 	}
230 230
 
Please login to merge, or discard this patch.
lib/private/Server.php 1 patch
Spacing   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 		$this->registerAlias(\OCP\Contacts\IManager::class, \OC\ContactsManager::class);
134 134
 		$this->registerAlias('ContactsManager', \OCP\Contacts\IManager::class);
135 135
 
136
-		$this->registerService(\OCP\IPreview::class, function (Server $c) {
136
+		$this->registerService(\OCP\IPreview::class, function(Server $c) {
137 137
 			return new PreviewManager(
138 138
 				$c->getConfig(),
139 139
 				$c->getRootFolder(),
@@ -144,13 +144,13 @@  discard block
 block discarded – undo
144 144
 		});
145 145
 		$this->registerAlias('PreviewManager', \OCP\IPreview::class);
146 146
 
147
-		$this->registerService(\OC\Preview\Watcher::class, function (Server $c) {
147
+		$this->registerService(\OC\Preview\Watcher::class, function(Server $c) {
148 148
 			return new \OC\Preview\Watcher(
149 149
 				$c->getAppDataDir('preview')
150 150
 			);
151 151
 		});
152 152
 
153
-		$this->registerService('EncryptionManager', function (Server $c) {
153
+		$this->registerService('EncryptionManager', function(Server $c) {
154 154
 			$view = new View();
155 155
 			$util = new Encryption\Util(
156 156
 				$view,
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
 			);
169 169
 		});
170 170
 
171
-		$this->registerService('EncryptionFileHelper', function (Server $c) {
171
+		$this->registerService('EncryptionFileHelper', function(Server $c) {
172 172
 			$util = new Encryption\Util(
173 173
 				new View(),
174 174
 				$c->getUserManager(),
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 			return new Encryption\File($util);
179 179
 		});
180 180
 
181
-		$this->registerService('EncryptionKeyStorage', function (Server $c) {
181
+		$this->registerService('EncryptionKeyStorage', function(Server $c) {
182 182
 			$view = new View();
183 183
 			$util = new Encryption\Util(
184 184
 				$view,
@@ -189,32 +189,32 @@  discard block
 block discarded – undo
189 189
 
190 190
 			return new Encryption\Keys\Storage($view, $util);
191 191
 		});
192
-		$this->registerService('TagMapper', function (Server $c) {
192
+		$this->registerService('TagMapper', function(Server $c) {
193 193
 			return new TagMapper($c->getDatabaseConnection());
194 194
 		});
195 195
 
196
-		$this->registerService(\OCP\ITagManager::class, function (Server $c) {
196
+		$this->registerService(\OCP\ITagManager::class, function(Server $c) {
197 197
 			$tagMapper = $c->query('TagMapper');
198 198
 			return new TagManager($tagMapper, $c->getUserSession());
199 199
 		});
200 200
 		$this->registerAlias('TagManager', \OCP\ITagManager::class);
201 201
 
202
-		$this->registerService('SystemTagManagerFactory', function (Server $c) {
202
+		$this->registerService('SystemTagManagerFactory', function(Server $c) {
203 203
 			$config = $c->getConfig();
204 204
 			$factoryClass = $config->getSystemValue('systemtags.managerFactory', '\OC\SystemTag\ManagerFactory');
205 205
 			/** @var \OC\SystemTag\ManagerFactory $factory */
206 206
 			$factory = new $factoryClass($this);
207 207
 			return $factory;
208 208
 		});
209
-		$this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) {
209
+		$this->registerService(\OCP\SystemTag\ISystemTagManager::class, function(Server $c) {
210 210
 			return $c->query('SystemTagManagerFactory')->getManager();
211 211
 		});
212 212
 		$this->registerAlias('SystemTagManager', \OCP\SystemTag\ISystemTagManager::class);
213 213
 
214
-		$this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function (Server $c) {
214
+		$this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function(Server $c) {
215 215
 			return $c->query('SystemTagManagerFactory')->getObjectMapper();
216 216
 		});
217
-		$this->registerService('RootFolder', function (Server $c) {
217
+		$this->registerService('RootFolder', function(Server $c) {
218 218
 			$manager = \OC\Files\Filesystem::getMountManager(null);
219 219
 			$view = new View();
220 220
 			$root = new Root(
@@ -242,30 +242,30 @@  discard block
 block discarded – undo
242 242
 		});
243 243
 		$this->registerAlias('LazyRootFolder', \OCP\Files\IRootFolder::class);
244 244
 
245
-		$this->registerService(\OCP\IUserManager::class, function (Server $c) {
245
+		$this->registerService(\OCP\IUserManager::class, function(Server $c) {
246 246
 			$config = $c->getConfig();
247 247
 			return new \OC\User\Manager($config);
248 248
 		});
249 249
 		$this->registerAlias('UserManager', \OCP\IUserManager::class);
250 250
 
251
-		$this->registerService(\OCP\IGroupManager::class, function (Server $c) {
251
+		$this->registerService(\OCP\IGroupManager::class, function(Server $c) {
252 252
 			$groupManager = new \OC\Group\Manager($this->getUserManager(), $this->getLogger());
253
-			$groupManager->listen('\OC\Group', 'preCreate', function ($gid) {
253
+			$groupManager->listen('\OC\Group', 'preCreate', function($gid) {
254 254
 				\OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid));
255 255
 			});
256
-			$groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) {
256
+			$groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) {
257 257
 				\OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID()));
258 258
 			});
259
-			$groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) {
259
+			$groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) {
260 260
 				\OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID()));
261 261
 			});
262
-			$groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) {
262
+			$groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) {
263 263
 				\OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID()));
264 264
 			});
265
-			$groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
265
+			$groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
266 266
 				\OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID()));
267 267
 			});
268
-			$groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) {
268
+			$groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) {
269 269
 				\OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID()));
270 270
 				//Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks
271 271
 				\OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID()));
@@ -285,11 +285,11 @@  discard block
 block discarded – undo
285 285
 			return new Store($session, $logger, $tokenProvider);
286 286
 		});
287 287
 		$this->registerAlias(IStore::class, Store::class);
288
-		$this->registerService('OC\Authentication\Token\DefaultTokenMapper', function (Server $c) {
288
+		$this->registerService('OC\Authentication\Token\DefaultTokenMapper', function(Server $c) {
289 289
 			$dbConnection = $c->getDatabaseConnection();
290 290
 			return new Authentication\Token\DefaultTokenMapper($dbConnection);
291 291
 		});
292
-		$this->registerService('OC\Authentication\Token\DefaultTokenProvider', function (Server $c) {
292
+		$this->registerService('OC\Authentication\Token\DefaultTokenProvider', function(Server $c) {
293 293
 			$mapper = $c->query('OC\Authentication\Token\DefaultTokenMapper');
294 294
 			$crypto = $c->getCrypto();
295 295
 			$config = $c->getConfig();
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 		});
300 300
 		$this->registerAlias('OC\Authentication\Token\IProvider', 'OC\Authentication\Token\DefaultTokenProvider');
301 301
 
302
-		$this->registerService(\OCP\IUserSession::class, function (Server $c) {
302
+		$this->registerService(\OCP\IUserSession::class, function(Server $c) {
303 303
 			$manager = $c->getUserManager();
304 304
 			$session = new \OC\Session\Memory('');
305 305
 			$timeFactory = new TimeFactory();
@@ -312,40 +312,40 @@  discard block
 block discarded – undo
312 312
 			}
313 313
 
314 314
 			$userSession = new \OC\User\Session($manager, $session, $timeFactory, $defaultTokenProvider, $c->getConfig(), $c->getSecureRandom());
315
-			$userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) {
315
+			$userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) {
316 316
 				\OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password));
317 317
 			});
318
-			$userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) {
318
+			$userSession->listen('\OC\User', 'postCreateUser', function($user, $password) {
319 319
 				/** @var $user \OC\User\User */
320 320
 				\OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password));
321 321
 			});
322
-			$userSession->listen('\OC\User', 'preDelete', function ($user) {
322
+			$userSession->listen('\OC\User', 'preDelete', function($user) {
323 323
 				/** @var $user \OC\User\User */
324 324
 				\OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID()));
325 325
 			});
326
-			$userSession->listen('\OC\User', 'postDelete', function ($user) {
326
+			$userSession->listen('\OC\User', 'postDelete', function($user) {
327 327
 				/** @var $user \OC\User\User */
328 328
 				\OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID()));
329 329
 			});
330
-			$userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) {
330
+			$userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) {
331 331
 				/** @var $user \OC\User\User */
332 332
 				\OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword));
333 333
 			});
334
-			$userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) {
334
+			$userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) {
335 335
 				/** @var $user \OC\User\User */
336 336
 				\OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword));
337 337
 			});
338
-			$userSession->listen('\OC\User', 'preLogin', function ($uid, $password) {
338
+			$userSession->listen('\OC\User', 'preLogin', function($uid, $password) {
339 339
 				\OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password));
340 340
 			});
341
-			$userSession->listen('\OC\User', 'postLogin', function ($user, $password) {
341
+			$userSession->listen('\OC\User', 'postLogin', function($user, $password) {
342 342
 				/** @var $user \OC\User\User */
343 343
 				\OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password));
344 344
 			});
345
-			$userSession->listen('\OC\User', 'logout', function () {
345
+			$userSession->listen('\OC\User', 'logout', function() {
346 346
 				\OC_Hook::emit('OC_User', 'logout', array());
347 347
 			});
348
-			$userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value) {
348
+			$userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value) {
349 349
 				/** @var $user \OC\User\User */
350 350
 				\OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value));
351 351
 			});
@@ -353,11 +353,11 @@  discard block
 block discarded – undo
353 353
 		});
354 354
 		$this->registerAlias('UserSession', \OCP\IUserSession::class);
355 355
 
356
-		$this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function (Server $c) {
356
+		$this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function(Server $c) {
357 357
 			return new \OC\Authentication\TwoFactorAuth\Manager($c->getAppManager(), $c->getSession(), $c->getConfig(), $c->getActivityManager(), $c->getLogger());
358 358
 		});
359 359
 
360
-		$this->registerService(\OCP\INavigationManager::class, function (Server $c) {
360
+		$this->registerService(\OCP\INavigationManager::class, function(Server $c) {
361 361
 			return new \OC\NavigationManager($c->getAppManager(),
362 362
 				$c->getURLGenerator(),
363 363
 				$c->getL10NFactory(),
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
 		});
367 367
 		$this->registerAlias('NavigationManager', \OCP\INavigationManager::class);
368 368
 
369
-		$this->registerService(\OC\AllConfig::class, function (Server $c) {
369
+		$this->registerService(\OC\AllConfig::class, function(Server $c) {
370 370
 			return new \OC\AllConfig(
371 371
 				$c->getSystemConfig()
372 372
 			);
@@ -374,17 +374,17 @@  discard block
 block discarded – undo
374 374
 		$this->registerAlias('AllConfig', \OC\AllConfig::class);
375 375
 		$this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class);
376 376
 
377
-		$this->registerService('SystemConfig', function ($c) use ($config) {
377
+		$this->registerService('SystemConfig', function($c) use ($config) {
378 378
 			return new \OC\SystemConfig($config);
379 379
 		});
380 380
 
381
-		$this->registerService(\OC\AppConfig::class, function (Server $c) {
381
+		$this->registerService(\OC\AppConfig::class, function(Server $c) {
382 382
 			return new \OC\AppConfig($c->getDatabaseConnection());
383 383
 		});
384 384
 		$this->registerAlias('AppConfig', \OC\AppConfig::class);
385 385
 		$this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class);
386 386
 
387
-		$this->registerService(\OCP\L10N\IFactory::class, function (Server $c) {
387
+		$this->registerService(\OCP\L10N\IFactory::class, function(Server $c) {
388 388
 			return new \OC\L10N\Factory(
389 389
 				$c->getConfig(),
390 390
 				$c->getRequest(),
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 		});
395 395
 		$this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class);
396 396
 
397
-		$this->registerService(\OCP\IURLGenerator::class, function (Server $c) {
397
+		$this->registerService(\OCP\IURLGenerator::class, function(Server $c) {
398 398
 			$config = $c->getConfig();
399 399
 			$cacheFactory = $c->getMemCacheFactory();
400 400
 			return new \OC\URLGenerator(
@@ -404,10 +404,10 @@  discard block
 block discarded – undo
404 404
 		});
405 405
 		$this->registerAlias('URLGenerator', \OCP\IURLGenerator::class);
406 406
 
407
-		$this->registerService('AppHelper', function ($c) {
407
+		$this->registerService('AppHelper', function($c) {
408 408
 			return new \OC\AppHelper();
409 409
 		});
410
-		$this->registerService('AppFetcher', function ($c) {
410
+		$this->registerService('AppFetcher', function($c) {
411 411
 			return new AppFetcher(
412 412
 				$this->getAppDataDir('appstore'),
413 413
 				$this->getHTTPClientService(),
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
 				$this->getConfig()
416 416
 			);
417 417
 		});
418
-		$this->registerService('CategoryFetcher', function ($c) {
418
+		$this->registerService('CategoryFetcher', function($c) {
419 419
 			return new CategoryFetcher(
420 420
 				$this->getAppDataDir('appstore'),
421 421
 				$this->getHTTPClientService(),
@@ -424,21 +424,21 @@  discard block
 block discarded – undo
424 424
 			);
425 425
 		});
426 426
 
427
-		$this->registerService(\OCP\ICache::class, function ($c) {
427
+		$this->registerService(\OCP\ICache::class, function($c) {
428 428
 			return new Cache\File();
429 429
 		});
430 430
 		$this->registerAlias('UserCache', \OCP\ICache::class);
431 431
 
432
-		$this->registerService(Factory::class, function (Server $c) {
432
+		$this->registerService(Factory::class, function(Server $c) {
433 433
 			$config = $c->getConfig();
434 434
 
435 435
 			if ($config->getSystemValue('installed', false) && !(defined('PHPUNIT_RUN') && PHPUNIT_RUN)) {
436 436
 				$v = \OC_App::getAppVersions();
437
-				$v['core'] = md5(file_get_contents(\OC::$SERVERROOT . '/version.php'));
437
+				$v['core'] = md5(file_get_contents(\OC::$SERVERROOT.'/version.php'));
438 438
 				$version = implode(',', $v);
439 439
 				$instanceId = \OC_Util::getInstanceId();
440 440
 				$path = \OC::$SERVERROOT;
441
-				$prefix = md5($instanceId . '-' . $version . '-' . $path . '-' . \OC::$WEBROOT);
441
+				$prefix = md5($instanceId.'-'.$version.'-'.$path.'-'.\OC::$WEBROOT);
442 442
 				return new \OC\Memcache\Factory($prefix, $c->getLogger(),
443 443
 					$config->getSystemValue('memcache.local', null),
444 444
 					$config->getSystemValue('memcache.distributed', null),
@@ -455,12 +455,12 @@  discard block
 block discarded – undo
455 455
 		$this->registerAlias('MemCacheFactory', Factory::class);
456 456
 		$this->registerAlias(ICacheFactory::class, Factory::class);
457 457
 
458
-		$this->registerService('RedisFactory', function (Server $c) {
458
+		$this->registerService('RedisFactory', function(Server $c) {
459 459
 			$systemConfig = $c->getSystemConfig();
460 460
 			return new RedisFactory($systemConfig);
461 461
 		});
462 462
 
463
-		$this->registerService(\OCP\Activity\IManager::class, function (Server $c) {
463
+		$this->registerService(\OCP\Activity\IManager::class, function(Server $c) {
464 464
 			return new \OC\Activity\Manager(
465 465
 				$c->getRequest(),
466 466
 				$c->getUserSession(),
@@ -470,14 +470,14 @@  discard block
 block discarded – undo
470 470
 		});
471 471
 		$this->registerAlias('ActivityManager', \OCP\Activity\IManager::class);
472 472
 
473
-		$this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) {
473
+		$this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) {
474 474
 			return new \OC\Activity\EventMerger(
475 475
 				$c->getL10N('lib')
476 476
 			);
477 477
 		});
478 478
 		$this->registerAlias(IValidator::class, Validator::class);
479 479
 
480
-		$this->registerService(\OCP\IAvatarManager::class, function (Server $c) {
480
+		$this->registerService(\OCP\IAvatarManager::class, function(Server $c) {
481 481
 			return new AvatarManager(
482 482
 				$c->getUserManager(),
483 483
 				$c->getAppDataDir('avatar'),
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
 		});
489 489
 		$this->registerAlias('AvatarManager', \OCP\IAvatarManager::class);
490 490
 
491
-		$this->registerService(\OCP\ILogger::class, function (Server $c) {
491
+		$this->registerService(\OCP\ILogger::class, function(Server $c) {
492 492
 			$logType = $c->query('AllConfig')->getSystemValue('log_type', 'file');
493 493
 			$logger = Log::getLogClass($logType);
494 494
 			call_user_func(array($logger, 'init'));
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
 		});
498 498
 		$this->registerAlias('Logger', \OCP\ILogger::class);
499 499
 
500
-		$this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) {
500
+		$this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) {
501 501
 			$config = $c->getConfig();
502 502
 			return new \OC\BackgroundJob\JobList(
503 503
 				$c->getDatabaseConnection(),
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
 		});
508 508
 		$this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class);
509 509
 
510
-		$this->registerService(\OCP\Route\IRouter::class, function (Server $c) {
510
+		$this->registerService(\OCP\Route\IRouter::class, function(Server $c) {
511 511
 			$cacheFactory = $c->getMemCacheFactory();
512 512
 			$logger = $c->getLogger();
513 513
 			if ($cacheFactory->isAvailable()) {
@@ -519,32 +519,32 @@  discard block
 block discarded – undo
519 519
 		});
520 520
 		$this->registerAlias('Router', \OCP\Route\IRouter::class);
521 521
 
522
-		$this->registerService(\OCP\ISearch::class, function ($c) {
522
+		$this->registerService(\OCP\ISearch::class, function($c) {
523 523
 			return new Search();
524 524
 		});
525 525
 		$this->registerAlias('Search', \OCP\ISearch::class);
526 526
 
527
-		$this->registerService(\OCP\Security\ISecureRandom::class, function ($c) {
527
+		$this->registerService(\OCP\Security\ISecureRandom::class, function($c) {
528 528
 			return new SecureRandom();
529 529
 		});
530 530
 		$this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class);
531 531
 
532
-		$this->registerService(\OCP\Security\ICrypto::class, function (Server $c) {
532
+		$this->registerService(\OCP\Security\ICrypto::class, function(Server $c) {
533 533
 			return new Crypto($c->getConfig(), $c->getSecureRandom());
534 534
 		});
535 535
 		$this->registerAlias('Crypto', \OCP\Security\ICrypto::class);
536 536
 
537
-		$this->registerService(\OCP\Security\IHasher::class, function (Server $c) {
537
+		$this->registerService(\OCP\Security\IHasher::class, function(Server $c) {
538 538
 			return new Hasher($c->getConfig());
539 539
 		});
540 540
 		$this->registerAlias('Hasher', \OCP\Security\IHasher::class);
541 541
 
542
-		$this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) {
542
+		$this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) {
543 543
 			return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection());
544 544
 		});
545 545
 		$this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class);
546 546
 
547
-		$this->registerService(IDBConnection::class, function (Server $c) {
547
+		$this->registerService(IDBConnection::class, function(Server $c) {
548 548
 			$systemConfig = $c->getSystemConfig();
549 549
 			$factory = new \OC\DB\ConnectionFactory($systemConfig);
550 550
 			$type = $systemConfig->getValue('dbtype', 'sqlite');
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
 		});
559 559
 		$this->registerAlias('DatabaseConnection', IDBConnection::class);
560 560
 
561
-		$this->registerService('HTTPHelper', function (Server $c) {
561
+		$this->registerService('HTTPHelper', function(Server $c) {
562 562
 			$config = $c->getConfig();
563 563
 			return new HTTPHelper(
564 564
 				$config,
@@ -566,7 +566,7 @@  discard block
 block discarded – undo
566 566
 			);
567 567
 		});
568 568
 
569
-		$this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) {
569
+		$this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) {
570 570
 			$user = \OC_User::getUser();
571 571
 			$uid = $user ? $user : null;
572 572
 			return new ClientService(
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 		});
577 577
 		$this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class);
578 578
 
579
-		$this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) {
579
+		$this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) {
580 580
 			if ($c->getSystemConfig()->getValue('debug', false)) {
581 581
 				return new EventLogger();
582 582
 			} else {
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
 		});
586 586
 		$this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class);
587 587
 
588
-		$this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) {
588
+		$this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) {
589 589
 			if ($c->getSystemConfig()->getValue('debug', false)) {
590 590
 				return new QueryLogger();
591 591
 			} else {
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 		});
595 595
 		$this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class);
596 596
 
597
-		$this->registerService(TempManager::class, function (Server $c) {
597
+		$this->registerService(TempManager::class, function(Server $c) {
598 598
 			return new TempManager(
599 599
 				$c->getLogger(),
600 600
 				$c->getConfig()
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
 		$this->registerAlias('TempManager', TempManager::class);
604 604
 		$this->registerAlias(ITempManager::class, TempManager::class);
605 605
 
606
-		$this->registerService(AppManager::class, function (Server $c) {
606
+		$this->registerService(AppManager::class, function(Server $c) {
607 607
 			return new \OC\App\AppManager(
608 608
 				$c->getUserSession(),
609 609
 				$c->getAppConfig(),
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
 		$this->registerAlias('AppManager', AppManager::class);
616 616
 		$this->registerAlias(IAppManager::class, AppManager::class);
617 617
 
618
-		$this->registerService(\OCP\IDateTimeZone::class, function (Server $c) {
618
+		$this->registerService(\OCP\IDateTimeZone::class, function(Server $c) {
619 619
 			return new DateTimeZone(
620 620
 				$c->getConfig(),
621 621
 				$c->getSession()
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
 		});
624 624
 		$this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class);
625 625
 
626
-		$this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) {
626
+		$this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) {
627 627
 			$language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null);
628 628
 
629 629
 			return new DateTimeFormatter(
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
 		});
634 634
 		$this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class);
635 635
 
636
-		$this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) {
636
+		$this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) {
637 637
 			$mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger());
638 638
 			$listener = new UserMountCacheListener($mountCache);
639 639
 			$listener->listen($c->getUserManager());
@@ -641,10 +641,10 @@  discard block
 block discarded – undo
641 641
 		});
642 642
 		$this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class);
643 643
 
644
-		$this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) {
644
+		$this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) {
645 645
 			$loader = \OC\Files\Filesystem::getLoader();
646 646
 			$mountCache = $c->query('UserMountCache');
647
-			$manager =  new \OC\Files\Config\MountProviderCollection($loader, $mountCache);
647
+			$manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache);
648 648
 
649 649
 			// builtin providers
650 650
 
@@ -657,14 +657,14 @@  discard block
 block discarded – undo
657 657
 		});
658 658
 		$this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class);
659 659
 
660
-		$this->registerService('IniWrapper', function ($c) {
660
+		$this->registerService('IniWrapper', function($c) {
661 661
 			return new IniGetWrapper();
662 662
 		});
663
-		$this->registerService('AsyncCommandBus', function (Server $c) {
663
+		$this->registerService('AsyncCommandBus', function(Server $c) {
664 664
 			$jobList = $c->getJobList();
665 665
 			return new AsyncBus($jobList);
666 666
 		});
667
-		$this->registerService('TrustedDomainHelper', function ($c) {
667
+		$this->registerService('TrustedDomainHelper', function($c) {
668 668
 			return new TrustedDomainHelper($this->getConfig());
669 669
 		});
670 670
 		$this->registerService('Throttler', function(Server $c) {
@@ -675,10 +675,10 @@  discard block
 block discarded – undo
675 675
 				$c->getConfig()
676 676
 			);
677 677
 		});
678
-		$this->registerService('IntegrityCodeChecker', function (Server $c) {
678
+		$this->registerService('IntegrityCodeChecker', function(Server $c) {
679 679
 			// IConfig and IAppManager requires a working database. This code
680 680
 			// might however be called when ownCloud is not yet setup.
681
-			if(\OC::$server->getSystemConfig()->getValue('installed', false)) {
681
+			if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
682 682
 				$config = $c->getConfig();
683 683
 				$appManager = $c->getAppManager();
684 684
 			} else {
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
 					$c->getTempManager()
697 697
 			);
698 698
 		});
699
-		$this->registerService(\OCP\IRequest::class, function ($c) {
699
+		$this->registerService(\OCP\IRequest::class, function($c) {
700 700
 			if (isset($this['urlParams'])) {
701 701
 				$urlParams = $this['urlParams'];
702 702
 			} else {
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
 		});
733 733
 		$this->registerAlias('Request', \OCP\IRequest::class);
734 734
 
735
-		$this->registerService(\OCP\Mail\IMailer::class, function (Server $c) {
735
+		$this->registerService(\OCP\Mail\IMailer::class, function(Server $c) {
736 736
 			return new Mailer(
737 737
 				$c->getConfig(),
738 738
 				$c->getLogger(),
@@ -744,14 +744,14 @@  discard block
 block discarded – undo
744 744
 		$this->registerService('LDAPProvider', function(Server $c) {
745 745
 			$config = $c->getConfig();
746 746
 			$factoryClass = $config->getSystemValue('ldapProviderFactory', null);
747
-			if(is_null($factoryClass)) {
747
+			if (is_null($factoryClass)) {
748 748
 				throw new \Exception('ldapProviderFactory not set');
749 749
 			}
750 750
 			/** @var \OCP\LDAP\ILDAPProviderFactory $factory */
751 751
 			$factory = new $factoryClass($this);
752 752
 			return $factory->getLDAPProvider();
753 753
 		});
754
-		$this->registerService('LockingProvider', function (Server $c) {
754
+		$this->registerService('LockingProvider', function(Server $c) {
755 755
 			$ini = $c->getIniWrapper();
756 756
 			$config = $c->getConfig();
757 757
 			$ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time')));
@@ -767,37 +767,37 @@  discard block
 block discarded – undo
767 767
 			return new NoopLockingProvider();
768 768
 		});
769 769
 
770
-		$this->registerService(\OCP\Files\Mount\IMountManager::class, function () {
770
+		$this->registerService(\OCP\Files\Mount\IMountManager::class, function() {
771 771
 			return new \OC\Files\Mount\Manager();
772 772
 		});
773 773
 		$this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class);
774 774
 
775
-		$this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) {
775
+		$this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) {
776 776
 			return new \OC\Files\Type\Detection(
777 777
 				$c->getURLGenerator(),
778 778
 				\OC::$configDir,
779
-				\OC::$SERVERROOT . '/resources/config/'
779
+				\OC::$SERVERROOT.'/resources/config/'
780 780
 			);
781 781
 		});
782 782
 		$this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class);
783 783
 
784
-		$this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) {
784
+		$this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) {
785 785
 			return new \OC\Files\Type\Loader(
786 786
 				$c->getDatabaseConnection()
787 787
 			);
788 788
 		});
789 789
 		$this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class);
790 790
 
791
-		$this->registerService(\OCP\Notification\IManager::class, function (Server $c) {
791
+		$this->registerService(\OCP\Notification\IManager::class, function(Server $c) {
792 792
 			return new Manager(
793 793
 				$c->query(IValidator::class)
794 794
 			);
795 795
 		});
796 796
 		$this->registerAlias('NotificationManager', \OCP\Notification\IManager::class);
797 797
 
798
-		$this->registerService(\OC\CapabilitiesManager::class, function (Server $c) {
798
+		$this->registerService(\OC\CapabilitiesManager::class, function(Server $c) {
799 799
 			$manager = new \OC\CapabilitiesManager($c->getLogger());
800
-			$manager->registerCapability(function () use ($c) {
800
+			$manager->registerCapability(function() use ($c) {
801 801
 				return new \OC\OCS\CoreCapabilities($c->getConfig());
802 802
 			});
803 803
 			return $manager;
@@ -854,13 +854,13 @@  discard block
 block discarded – undo
854 854
 
855 855
 			);
856 856
 		});
857
-		$this->registerService(EventDispatcher::class, function () {
857
+		$this->registerService(EventDispatcher::class, function() {
858 858
 			return new EventDispatcher();
859 859
 		});
860 860
 		$this->registerAlias('EventDispatcher', EventDispatcher::class);
861 861
 		$this->registerAlias(EventDispatcherInterface::class, EventDispatcher::class);
862 862
 
863
-		$this->registerService('CryptoWrapper', function (Server $c) {
863
+		$this->registerService('CryptoWrapper', function(Server $c) {
864 864
 			// FIXME: Instantiiated here due to cyclic dependency
865 865
 			$request = new Request(
866 866
 				[
@@ -885,7 +885,7 @@  discard block
 block discarded – undo
885 885
 				$request
886 886
 			);
887 887
 		});
888
-		$this->registerService('CsrfTokenManager', function (Server $c) {
888
+		$this->registerService('CsrfTokenManager', function(Server $c) {
889 889
 			$tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom());
890 890
 
891 891
 			return new CsrfTokenManager(
@@ -893,10 +893,10 @@  discard block
 block discarded – undo
893 893
 				$c->query(SessionStorage::class)
894 894
 			);
895 895
 		});
896
-		$this->registerService(SessionStorage::class, function (Server $c) {
896
+		$this->registerService(SessionStorage::class, function(Server $c) {
897 897
 			return new SessionStorage($c->getSession());
898 898
 		});
899
-		$this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function (Server $c) {
899
+		$this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function(Server $c) {
900 900
 			return new ContentSecurityPolicyManager();
901 901
 		});
902 902
 		$this->registerAlias('ContentSecurityPolicyManager', \OCP\Security\IContentSecurityPolicyManager::class);
@@ -947,23 +947,23 @@  discard block
 block discarded – undo
947 947
 			);
948 948
 			return $manager;
949 949
 		});
950
-		$this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) {
950
+		$this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) {
951 951
 			return new \OC\Files\AppData\Factory(
952 952
 				$c->getRootFolder(),
953 953
 				$c->getSystemConfig()
954 954
 			);
955 955
 		});
956 956
 
957
-		$this->registerService('LockdownManager', function (Server $c) {
957
+		$this->registerService('LockdownManager', function(Server $c) {
958 958
 			return new LockdownManager();
959 959
 		});
960 960
 
961
-		$this->registerService(ICloudIdManager::class, function (Server $c) {
961
+		$this->registerService(ICloudIdManager::class, function(Server $c) {
962 962
 			return new CloudIdManager();
963 963
 		});
964 964
 
965 965
 		/* To trick DI since we don't extend the DIContainer here */
966
-		$this->registerService(CleanPreviewsBackgroundJob::class, function (Server $c) {
966
+		$this->registerService(CleanPreviewsBackgroundJob::class, function(Server $c) {
967 967
 			return new CleanPreviewsBackgroundJob(
968 968
 				$c->getRootFolder(),
969 969
 				$c->getLogger(),
@@ -1117,7 +1117,7 @@  discard block
 block discarded – undo
1117 1117
 	 * @deprecated since 9.2.0 use IAppData
1118 1118
 	 */
1119 1119
 	public function getAppFolder() {
1120
-		$dir = '/' . \OC_App::getCurrentApp();
1120
+		$dir = '/'.\OC_App::getCurrentApp();
1121 1121
 		$root = $this->getRootFolder();
1122 1122
 		if (!$root->nodeExists($dir)) {
1123 1123
 			$folder = $root->newFolder($dir);
Please login to merge, or discard this patch.
lib/private/TemplateLayout.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -52,46 +52,46 @@  discard block
 block discarded – undo
52 52
 	 * @param string $renderAs
53 53
 	 * @param string $appId application id
54 54
 	 */
55
-	public function __construct( $renderAs, $appId = '' ) {
55
+	public function __construct($renderAs, $appId = '') {
56 56
 
57 57
 		// yes - should be injected ....
58 58
 		$this->config = \OC::$server->getConfig();
59 59
 
60 60
 
61 61
 		// Decide which page we show
62
-		if($renderAs == 'user') {
63
-			parent::__construct( 'core', 'layout.user' );
64
-			if(in_array(\OC_App::getCurrentApp(), ['settings','admin', 'help']) !== false) {
62
+		if ($renderAs == 'user') {
63
+			parent::__construct('core', 'layout.user');
64
+			if (in_array(\OC_App::getCurrentApp(), ['settings', 'admin', 'help']) !== false) {
65 65
 				$this->assign('bodyid', 'body-settings');
66
-			}else{
66
+			} else {
67 67
 				$this->assign('bodyid', 'body-user');
68 68
 			}
69 69
 
70 70
 			// Code integrity notification
71 71
 			$integrityChecker = \OC::$server->getIntegrityCodeChecker();
72
-			if(\OC_User::isAdminUser(\OC_User::getUser()) && $integrityChecker->isCodeCheckEnforced() && !$integrityChecker->hasPassedCheck()) {
72
+			if (\OC_User::isAdminUser(\OC_User::getUser()) && $integrityChecker->isCodeCheckEnforced() && !$integrityChecker->hasPassedCheck()) {
73 73
 				\OCP\Util::addScript('core', 'integritycheck-failed-notification');
74 74
 			}
75 75
 
76 76
 			// Add navigation entry
77
-			$this->assign( 'application', '');
78
-			$this->assign( 'appid', $appId );
77
+			$this->assign('application', '');
78
+			$this->assign('appid', $appId);
79 79
 			$navigation = \OC_App::getNavigation();
80
-			$this->assign( 'navigation', $navigation);
80
+			$this->assign('navigation', $navigation);
81 81
 			$navigation = \OC_App::getHeaderNavigation();
82
-			$this->assign( 'headernavigation', $navigation);
82
+			$this->assign('headernavigation', $navigation);
83 83
 			$settingsNavigation = \OC_App::getSettingsNavigation();
84
-			$this->assign( 'settingsnavigation', $settingsNavigation);
85
-			foreach($navigation as $entry) {
84
+			$this->assign('settingsnavigation', $settingsNavigation);
85
+			foreach ($navigation as $entry) {
86 86
 				if ($entry['active']) {
87
-					$this->assign( 'application', $entry['name'] );
87
+					$this->assign('application', $entry['name']);
88 88
 					break;
89 89
 				}
90 90
 			}
91 91
 			
92
-			foreach($settingsNavigation as $entry) {
92
+			foreach ($settingsNavigation as $entry) {
93 93
 				if ($entry['active']) {
94
-					$this->assign( 'application', $entry['name'] );
94
+					$this->assign('application', $entry['name']);
95 95
 					break;
96 96
 				}
97 97
 			}
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
 		// Send the language to our layouts
126 126
 		$this->assign('language', \OC::$server->getL10NFactory()->findLanguage());
127 127
 
128
-		if(\OC::$server->getSystemConfig()->getValue('installed', false)) {
128
+		if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
129 129
 			if (empty(self::$versionHash)) {
130 130
 				$v = \OC_App::getAppVersions();
131 131
 				$v['core'] = implode('.', \OCP\Util::getVersion());
@@ -156,10 +156,10 @@  discard block
 block discarded – undo
156 156
 				$this->append('jsfiles', \OC::$server->getURLGenerator()->linkToRoute('core.OCJS.getConfig', ['v' => self::$versionHash]));
157 157
 			}
158 158
 		}
159
-		foreach($jsFiles as $info) {
159
+		foreach ($jsFiles as $info) {
160 160
 			$web = $info[1];
161 161
 			$file = $info[2];
162
-			$this->append( 'jsfiles', $web.'/'.$file . $this->getVersionHashSuffix() );
162
+			$this->append('jsfiles', $web.'/'.$file.$this->getVersionHashSuffix());
163 163
 		}
164 164
 
165 165
 		try {
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
 
171 171
 		// Do not initialise scss appdata until we have a fully installed instance
172 172
 		// Do not load scss for update, errors, installation or login page
173
-		if(\OC::$server->getSystemConfig()->getValue('installed', false)
173
+		if (\OC::$server->getSystemConfig()->getValue('installed', false)
174 174
 			&& !\OCP\Util::needUpgrade()
175 175
 			&& $pathInfo !== ''
176 176
 			&& !preg_match('/^\/login/', $pathInfo)) {
@@ -185,25 +185,25 @@  discard block
 block discarded – undo
185 185
 		$this->assign('cssfiles', array());
186 186
 		$this->assign('printcssfiles', []);
187 187
 		$this->assign('versionHash', self::$versionHash);
188
-		foreach($cssFiles as $info) {
188
+		foreach ($cssFiles as $info) {
189 189
 			$web = $info[1];
190 190
 			$file = $info[2];
191 191
 
192 192
 			if (substr($file, -strlen('print.css')) === 'print.css') {
193
-				$this->append( 'printcssfiles', $web.'/'.$file . $this->getVersionHashSuffix() );
193
+				$this->append('printcssfiles', $web.'/'.$file.$this->getVersionHashSuffix());
194 194
 			} else {
195
-				$this->append( 'cssfiles', $web.'/'.$file . $this->getVersionHashSuffix()  );
195
+				$this->append('cssfiles', $web.'/'.$file.$this->getVersionHashSuffix());
196 196
 			}
197 197
 		}
198 198
 	}
199 199
 
200 200
 	protected function getVersionHashSuffix() {
201
-		if(\OC::$server->getConfig()->getSystemValue('debug', false)) {
201
+		if (\OC::$server->getConfig()->getSystemValue('debug', false)) {
202 202
 			// allows chrome workspace mapping in debug mode
203 203
 			return "";
204 204
 		}
205 205
 
206
-		return '?v=' . self::$versionHash;
206
+		return '?v='.self::$versionHash;
207 207
 	}
208 208
 
209 209
 	/**
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 		// Read the selected theme from the config file
215 215
 		$theme = \OC_Util::getTheme();
216 216
 
217
-		if($compileScss) {
217
+		if ($compileScss) {
218 218
 			$SCSSCacher = \OC::$server->query(SCSSCacher::class);
219 219
 		} else {
220 220
 			$SCSSCacher = null;
@@ -223,8 +223,8 @@  discard block
 block discarded – undo
223 223
 		$locator = new \OC\Template\CSSResourceLocator(
224 224
 			\OC::$server->getLogger(),
225 225
 			$theme,
226
-			array( \OC::$SERVERROOT => \OC::$WEBROOT ),
227
-			array( \OC::$SERVERROOT => \OC::$WEBROOT ),
226
+			array(\OC::$SERVERROOT => \OC::$WEBROOT),
227
+			array(\OC::$SERVERROOT => \OC::$WEBROOT),
228 228
 			$SCSSCacher
229 229
 		);
230 230
 		$locator->find($styles);
@@ -242,8 +242,8 @@  discard block
 block discarded – undo
242 242
 		$locator = new \OC\Template\JSResourceLocator(
243 243
 			\OC::$server->getLogger(),
244 244
 			$theme,
245
-			array( \OC::$SERVERROOT => \OC::$WEBROOT ),
246
-			array( \OC::$SERVERROOT => \OC::$WEBROOT ),
245
+			array(\OC::$SERVERROOT => \OC::$WEBROOT),
246
+			array(\OC::$SERVERROOT => \OC::$WEBROOT),
247 247
 			new JSCombiner(
248 248
 				\OC::$server->getAppDataDir('js'),
249 249
 				\OC::$server->getURLGenerator(),
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 	 */
264 264
 	public static function convertToRelativePath($filePath) {
265 265
 		$relativePath = explode(\OC::$SERVERROOT, $filePath);
266
-		if(count($relativePath) !== 2) {
266
+		if (count($relativePath) !== 2) {
267 267
 			throw new \Exception('$filePath is not under the \OC::$SERVERROOT');
268 268
 		}
269 269
 
Please login to merge, or discard this patch.