Passed
Push — master ( 514dc4...3085cf )
by Roeland
10:26 queued 13s
created
lib/private/AppFramework/DependencyInjection/DIContainer.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -115,68 +115,68 @@  discard block
 block discarded – undo
115 115
 		/**
116 116
 		 * Core services
117 117
 		 */
118
-		$this->registerService(IOutput::class, function () {
118
+		$this->registerService(IOutput::class, function() {
119 119
 			return new Output($this->getServer()->getWebRoot());
120 120
 		});
121 121
 
122
-		$this->registerService(Folder::class, function () {
122
+		$this->registerService(Folder::class, function() {
123 123
 			return $this->getServer()->getUserFolder();
124 124
 		});
125 125
 
126
-		$this->registerService(IAppData::class, function (ContainerInterface $c) {
126
+		$this->registerService(IAppData::class, function(ContainerInterface $c) {
127 127
 			return $this->getServer()->getAppDataDir($c->get('AppName'));
128 128
 		});
129 129
 
130
-		$this->registerService(IL10N::class, function (ContainerInterface $c) {
130
+		$this->registerService(IL10N::class, function(ContainerInterface $c) {
131 131
 			return $this->getServer()->getL10N($c->get('AppName'));
132 132
 		});
133 133
 
134 134
 		// Log wrappers
135
-		$this->registerService(LoggerInterface::class, function (ContainerInterface $c) {
135
+		$this->registerService(LoggerInterface::class, function(ContainerInterface $c) {
136 136
 			return new ScopedPsrLogger(
137 137
 				$c->get(PsrLoggerAdapter::class),
138 138
 				$c->get('AppName')
139 139
 			);
140 140
 		});
141
-		$this->registerService(ILogger::class, function (ContainerInterface $c) {
141
+		$this->registerService(ILogger::class, function(ContainerInterface $c) {
142 142
 			return new OC\AppFramework\Logger($this->server->query(ILogger::class), $c->get('AppName'));
143 143
 		});
144 144
 
145
-		$this->registerService(IServerContainer::class, function () {
145
+		$this->registerService(IServerContainer::class, function() {
146 146
 			return $this->getServer();
147 147
 		});
148 148
 		$this->registerAlias('ServerContainer', IServerContainer::class);
149 149
 
150
-		$this->registerService(\OCP\WorkflowEngine\IManager::class, function (ContainerInterface $c) {
150
+		$this->registerService(\OCP\WorkflowEngine\IManager::class, function(ContainerInterface $c) {
151 151
 			return $c->get(Manager::class);
152 152
 		});
153 153
 
154
-		$this->registerService(ContainerInterface::class, function (ContainerInterface $c) {
154
+		$this->registerService(ContainerInterface::class, function(ContainerInterface $c) {
155 155
 			return $c;
156 156
 		});
157 157
 		$this->registerAlias(IAppContainer::class, ContainerInterface::class);
158 158
 
159 159
 		// commonly used attributes
160
-		$this->registerService('UserId', function (ContainerInterface $c) {
160
+		$this->registerService('UserId', function(ContainerInterface $c) {
161 161
 			return $c->get(IUserSession::class)->getSession()->get('user_id');
162 162
 		});
163 163
 
164
-		$this->registerService('WebRoot', function (ContainerInterface $c) {
164
+		$this->registerService('WebRoot', function(ContainerInterface $c) {
165 165
 			return $c->get(IServerContainer::class)->getWebRoot();
166 166
 		});
167 167
 
168
-		$this->registerService('OC_Defaults', function (ContainerInterface $c) {
168
+		$this->registerService('OC_Defaults', function(ContainerInterface $c) {
169 169
 			return $c->get(IServerContainer::class)->getThemingDefaults();
170 170
 		});
171 171
 
172
-		$this->registerService('Protocol', function (ContainerInterface $c) {
172
+		$this->registerService('Protocol', function(ContainerInterface $c) {
173 173
 			/** @var \OC\Server $server */
174 174
 			$server = $c->get(IServerContainer::class);
175 175
 			$protocol = $server->getRequest()->getHttpProtocol();
176 176
 			return new Http($_SERVER, $protocol);
177 177
 		});
178 178
 
179
-		$this->registerService('Dispatcher', function (ContainerInterface $c) {
179
+		$this->registerService('Dispatcher', function(ContainerInterface $c) {
180 180
 			return new Dispatcher(
181 181
 				$c->get('Protocol'),
182 182
 				$c->get(MiddlewareDispatcher::class),
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 		 * Middleware
197 197
 		 */
198 198
 		$this->registerAlias('MiddlewareDispatcher', MiddlewareDispatcher::class);
199
-		$this->registerService(MiddlewareDispatcher::class, function (ContainerInterface $c) {
199
+		$this->registerService(MiddlewareDispatcher::class, function(ContainerInterface $c) {
200 200
 			$server = $this->getServer();
201 201
 
202 202
 			$dispatcher = new MiddlewareDispatcher();
@@ -312,13 +312,13 @@  discard block
 block discarded – undo
312 312
 			return $dispatcher;
313 313
 		});
314 314
 
315
-		$this->registerService(IAppConfig::class, function (ContainerInterface $c) {
315
+		$this->registerService(IAppConfig::class, function(ContainerInterface $c) {
316 316
 			return new OC\AppFramework\Services\AppConfig(
317 317
 				$c->get(IConfig::class),
318 318
 				$c->get('AppName')
319 319
 			);
320 320
 		});
321
-		$this->registerService(IInitialState::class, function (ContainerInterface $c) {
321
+		$this->registerService(IInitialState::class, function(ContainerInterface $c) {
322 322
 			return new OC\AppFramework\Services\InitialState(
323 323
 				$c->get(IInitialStateService::class),
324 324
 				$c->get('AppName')
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 	 * @param string $serviceName e.g. 'OCA\Files\Capabilities'
407 407
 	 */
408 408
 	public function registerCapability($serviceName) {
409
-		$this->query('OC\CapabilitiesManager')->registerCapability(function () use ($serviceName) {
409
+		$this->query('OC\CapabilitiesManager')->registerCapability(function() use ($serviceName) {
410 410
 			return $this->query($serviceName);
411 411
 		});
412 412
 	}
@@ -452,11 +452,11 @@  discard block
 block discarded – undo
452 452
 			return parent::query($name);
453 453
 		} elseif ($this['AppName'] === 'core' && strpos($name, 'OC\\Core\\') === 0) {
454 454
 			return parent::query($name);
455
-		} elseif (strpos($name, \OC\AppFramework\App::buildAppNamespace($this['AppName']) . '\\') === 0) {
455
+		} elseif (strpos($name, \OC\AppFramework\App::buildAppNamespace($this['AppName']).'\\') === 0) {
456 456
 			return parent::query($name);
457 457
 		}
458 458
 
459
-		throw new QueryException('Could not resolve ' . $name . '!' .
459
+		throw new QueryException('Could not resolve '.$name.'!'.
460 460
 			' Class can not be instantiated', 1);
461 461
 	}
462 462
 }
Please login to merge, or discard this patch.