Passed
Push — master ( b42b26...10e2ed )
by Roeland
10:17 queued 10s
created
apps/files_external/lib/Service/BackendService.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
 	private function callForRegistrations() {
110 110
 		static $eventSent = false;
111
-		if(!$eventSent) {
111
+		if (!$eventSent) {
112 112
 			\OC::$server->getEventDispatcher()->dispatch(
113 113
 				'OCA\\Files_External::loadAdditionalBackends'
114 114
 			);
@@ -318,15 +318,15 @@  discard block
 block discarded – undo
318 318
 	 */
319 319
 	public function registerConfigHandler(string $placeholder, callable $configHandlerLoader) {
320 320
 		$placeholder = trim(strtolower($placeholder));
321
-		if(!(bool)\preg_match('/^[a-z0-9]*$/', $placeholder)) {
321
+		if (!(bool) \preg_match('/^[a-z0-9]*$/', $placeholder)) {
322 322
 			throw new \RuntimeException(sprintf(
323 323
 				'Invalid placeholder %s, only [a-z0-9] are allowed', $placeholder
324 324
 			));
325 325
 		}
326
-		if($placeholder === '') {
326
+		if ($placeholder === '') {
327 327
 			throw new \RuntimeException('Invalid empty placeholder');
328 328
 		}
329
-		if(isset($this->configHandlerLoaders[$placeholder]) || isset($this->configHandlers[$placeholder])) {
329
+		if (isset($this->configHandlerLoaders[$placeholder]) || isset($this->configHandlers[$placeholder])) {
330 330
 			throw new \RuntimeException(sprintf('A handler is already registered for %s', $placeholder));
331 331
 		}
332 332
 		$this->configHandlerLoaders[$placeholder] = $configHandlerLoader;
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 		$newLoaded = false;
338 338
 		foreach ($this->configHandlerLoaders as $placeholder => $loader) {
339 339
 			$handler = $loader();
340
-			if(!$handler instanceof IConfigHandler) {
340
+			if (!$handler instanceof IConfigHandler) {
341 341
 				throw new \RuntimeException(sprintf(
342 342
 					'Handler for %s is not an instance of IConfigHandler', $placeholder
343 343
 				));
@@ -346,10 +346,10 @@  discard block
 block discarded – undo
346 346
 			$newLoaded = true;
347 347
 		}
348 348
 		$this->configHandlerLoaders = [];
349
-		if($newLoaded) {
349
+		if ($newLoaded) {
350 350
 			// ensure those with longest placeholders come first,
351 351
 			// to avoid substring matches
352
-			uksort($this->configHandlers, function ($phA, $phB) {
352
+			uksort($this->configHandlers, function($phA, $phB) {
353 353
 				return strlen($phB) <=> strlen($phA);
354 354
 			});
355 355
 		}
Please login to merge, or discard this patch.