Completed
Pull Request — master (#9310)
by Joas
79:24 queued 62:24
created
lib/private/AppFramework/DependencyInjection/DIContainer.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 * @param array $urlParams
84 84
 	 * @param ServerContainer|null $server
85 85
 	 */
86
-	public function __construct($appName, $urlParams = array(), ServerContainer $server = null){
86
+	public function __construct($appName, $urlParams = array(), ServerContainer $server = null) {
87 87
 		parent::__construct();
88 88
 		$this['AppName'] = $appName;
89 89
 		$this['urlParams'] = $urlParams;
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 		/**
104 104
 		 * Core services
105 105
 		 */
106
-		$this->registerService(IOutput::class, function($c){
106
+		$this->registerService(IOutput::class, function($c) {
107 107
 			return new Output($this->getServer()->getWebRoot());
108 108
 		});
109 109
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 			return $this->getServer()->getUserFolder();
112 112
 		});
113 113
 
114
-		$this->registerService(IAppData::class, function (SimpleContainer $c) {
114
+		$this->registerService(IAppData::class, function(SimpleContainer $c) {
115 115
 			return $this->getServer()->getAppDataDir($c->query('AppName'));
116 116
 		});
117 117
 
@@ -132,39 +132,39 @@  discard block
 block discarded – undo
132 132
 
133 133
 		$this->registerAlias(\OC\User\Session::class, \OCP\IUserSession::class);
134 134
 
135
-		$this->registerService(IServerContainer::class, function ($c) {
135
+		$this->registerService(IServerContainer::class, function($c) {
136 136
 			return $this->getServer();
137 137
 		});
138 138
 		$this->registerAlias('ServerContainer', IServerContainer::class);
139 139
 
140
-		$this->registerService(\OCP\WorkflowEngine\IManager::class, function ($c) {
140
+		$this->registerService(\OCP\WorkflowEngine\IManager::class, function($c) {
141 141
 			return $c->query(Manager::class);
142 142
 		});
143 143
 
144
-		$this->registerService(\OCP\AppFramework\IAppContainer::class, function ($c) {
144
+		$this->registerService(\OCP\AppFramework\IAppContainer::class, function($c) {
145 145
 			return $c;
146 146
 		});
147 147
 
148 148
 		$this->registerAlias(ISearchResult::class, SearchResult::class);
149 149
 
150 150
 		// commonly used attributes
151
-		$this->registerService('UserId', function ($c) {
151
+		$this->registerService('UserId', function($c) {
152 152
 			return $c->query(IUserSession::class)->getSession()->get('user_id');
153 153
 		});
154 154
 
155
-		$this->registerService('WebRoot', function ($c) {
155
+		$this->registerService('WebRoot', function($c) {
156 156
 			return $c->query('ServerContainer')->getWebRoot();
157 157
 		});
158 158
 
159
-		$this->registerService('OC_Defaults', function ($c) {
159
+		$this->registerService('OC_Defaults', function($c) {
160 160
 			return $c->getServer()->getThemingDefaults();
161 161
 		});
162 162
 
163
-		$this->registerService(IManager::class, function ($c) {
163
+		$this->registerService(IManager::class, function($c) {
164 164
 			return $this->getServer()->getEncryptionManager();
165 165
 		});
166 166
 
167
-		$this->registerService(IConfig::class, function ($c) {
167
+		$this->registerService(IConfig::class, function($c) {
168 168
 			return $c->query(OC\GlobalScale\Config::class);
169 169
 		});
170 170
 
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 			return $c->query(Validator::class);
173 173
 		});
174 174
 
175
-		$this->registerService(\OC\Security\IdentityProof\Manager::class, function ($c) {
175
+		$this->registerService(\OC\Security\IdentityProof\Manager::class, function($c) {
176 176
 			return new \OC\Security\IdentityProof\Manager(
177 177
 				$this->getServer()->query(\OC\Files\AppData\Factory::class),
178 178
 				$this->getServer()->getCrypto(),
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
 			);
181 181
 		});
182 182
 
183
-		$this->registerService('Protocol', function($c){
183
+		$this->registerService('Protocol', function($c) {
184 184
 			/** @var \OC\Server $server */
185 185
 			$server = $c->query('ServerContainer');
186 186
 			$protocol = $server->getRequest()->getHttpProtocol();
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 			);
229 229
 		});
230 230
 
231
-		$this->registerService(OC\AppFramework\Middleware\Security\PasswordConfirmationMiddleware::class, function ($c) use ($app) {
231
+		$this->registerService(OC\AppFramework\Middleware\Security\PasswordConfirmationMiddleware::class, function($c) use ($app) {
232 232
 			/** @var \OC\Server $server */
233 233
 			$server = $app->getServer();
234 234
 
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 			);
281 281
 		});
282 282
 
283
-		$this->registerService('TwoFactorMiddleware', function (SimpleContainer $c) use ($app) {
283
+		$this->registerService('TwoFactorMiddleware', function(SimpleContainer $c) use ($app) {
284 284
 			$twoFactorManager = $c->getServer()->getTwoFactorAuthManager();
285 285
 			$userSession = $app->getServer()->getUserSession();
286 286
 			$session = $app->getServer()->getSession();
@@ -290,13 +290,13 @@  discard block
 block discarded – undo
290 290
 			return new TwoFactorMiddleware($twoFactorManager, $userSession, $session, $urlGenerator, $reflector, $request);
291 291
 		});
292 292
 
293
-		$this->registerService('OCSMiddleware', function (SimpleContainer $c) {
293
+		$this->registerService('OCSMiddleware', function(SimpleContainer $c) {
294 294
 			return new OCSMiddleware(
295 295
 				$c['Request']
296 296
 			);
297 297
 		});
298 298
 
299
-		$this->registerService(OC\AppFramework\Middleware\Security\SameSiteCookieMiddleware::class, function (SimpleContainer $c) {
299
+		$this->registerService(OC\AppFramework\Middleware\Security\SameSiteCookieMiddleware::class, function(SimpleContainer $c) {
300 300
 			return new OC\AppFramework\Middleware\Security\SameSiteCookieMiddleware(
301 301
 				$c['Request'],
302 302
 				$c['ControllerMethodReflector']
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 			$dispatcher->registerMiddleware($c['BruteForceMiddleware']);
316 316
 			$dispatcher->registerMiddleware($c['RateLimitingMiddleware']);
317 317
 
318
-			foreach($middleWares as $middleWare) {
318
+			foreach ($middleWares as $middleWare) {
319 319
 				$dispatcher->registerMiddleware($c[$middleWare]);
320 320
 			}
321 321
 
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
 	 * @return mixed
378 378
 	 */
379 379
 	public function log($message, $level) {
380
-		switch($level){
380
+		switch ($level) {
381 381
 			case 'debug':
382 382
 				$level = ILogger::DEBUG;
383 383
 				break;
@@ -443,12 +443,12 @@  discard block
 block discarded – undo
443 443
 				return parent::query($name);
444 444
 			} else if ($this['AppName'] === 'core' && strpos($name, 'OC\\Core\\') === 0) {
445 445
 				return parent::query($name);
446
-			} else if (strpos($name, \OC\AppFramework\App::buildAppNamespace($this['AppName']) . '\\') === 0) {
446
+			} else if (strpos($name, \OC\AppFramework\App::buildAppNamespace($this['AppName']).'\\') === 0) {
447 447
 				return parent::query($name);
448 448
 			}
449 449
 		}
450 450
 
451
-		throw new QueryException('Could not resolve ' . $name . '!' .
451
+		throw new QueryException('Could not resolve '.$name.'!'.
452 452
 			' Class can not be instantiated', 1);
453 453
 	}
454 454
 }
Please login to merge, or discard this patch.