@@ -119,68 +119,68 @@ discard block |
||
| 119 | 119 | /** |
| 120 | 120 | * Core services |
| 121 | 121 | */ |
| 122 | - $this->registerService(IOutput::class, function () { |
|
| 122 | + $this->registerService(IOutput::class, function() { |
|
| 123 | 123 | return new Output($this->getServer()->getWebRoot()); |
| 124 | 124 | }); |
| 125 | 125 | |
| 126 | - $this->registerService(Folder::class, function () { |
|
| 126 | + $this->registerService(Folder::class, function() { |
|
| 127 | 127 | return $this->getServer()->getUserFolder(); |
| 128 | 128 | }); |
| 129 | 129 | |
| 130 | - $this->registerService(IAppData::class, function (ContainerInterface $c) { |
|
| 130 | + $this->registerService(IAppData::class, function(ContainerInterface $c) { |
|
| 131 | 131 | return $this->getServer()->getAppDataDir($c->get('AppName')); |
| 132 | 132 | }); |
| 133 | 133 | |
| 134 | - $this->registerService(IL10N::class, function (ContainerInterface $c) { |
|
| 134 | + $this->registerService(IL10N::class, function(ContainerInterface $c) { |
|
| 135 | 135 | return $this->getServer()->getL10N($c->get('AppName')); |
| 136 | 136 | }); |
| 137 | 137 | |
| 138 | 138 | // Log wrappers |
| 139 | - $this->registerService(LoggerInterface::class, function (ContainerInterface $c) { |
|
| 139 | + $this->registerService(LoggerInterface::class, function(ContainerInterface $c) { |
|
| 140 | 140 | return new ScopedPsrLogger( |
| 141 | 141 | $c->get(PsrLoggerAdapter::class), |
| 142 | 142 | $c->get('AppName') |
| 143 | 143 | ); |
| 144 | 144 | }); |
| 145 | - $this->registerService(ILogger::class, function (ContainerInterface $c) { |
|
| 145 | + $this->registerService(ILogger::class, function(ContainerInterface $c) { |
|
| 146 | 146 | return new OC\AppFramework\Logger($this->server->query(ILogger::class), $c->get('AppName')); |
| 147 | 147 | }); |
| 148 | 148 | |
| 149 | - $this->registerService(IServerContainer::class, function () { |
|
| 149 | + $this->registerService(IServerContainer::class, function() { |
|
| 150 | 150 | return $this->getServer(); |
| 151 | 151 | }); |
| 152 | 152 | $this->registerAlias('ServerContainer', IServerContainer::class); |
| 153 | 153 | |
| 154 | - $this->registerService(\OCP\WorkflowEngine\IManager::class, function (ContainerInterface $c) { |
|
| 154 | + $this->registerService(\OCP\WorkflowEngine\IManager::class, function(ContainerInterface $c) { |
|
| 155 | 155 | return $c->get(Manager::class); |
| 156 | 156 | }); |
| 157 | 157 | |
| 158 | - $this->registerService(ContainerInterface::class, function (ContainerInterface $c) { |
|
| 158 | + $this->registerService(ContainerInterface::class, function(ContainerInterface $c) { |
|
| 159 | 159 | return $c; |
| 160 | 160 | }); |
| 161 | 161 | $this->registerAlias(IAppContainer::class, ContainerInterface::class); |
| 162 | 162 | |
| 163 | 163 | // commonly used attributes |
| 164 | - $this->registerService('userId', function (ContainerInterface $c) { |
|
| 164 | + $this->registerService('userId', function(ContainerInterface $c) { |
|
| 165 | 165 | return $c->get(IUserSession::class)->getSession()->get('user_id'); |
| 166 | 166 | }); |
| 167 | 167 | |
| 168 | - $this->registerService('webRoot', function (ContainerInterface $c) { |
|
| 168 | + $this->registerService('webRoot', function(ContainerInterface $c) { |
|
| 169 | 169 | return $c->get(IServerContainer::class)->getWebRoot(); |
| 170 | 170 | }); |
| 171 | 171 | |
| 172 | - $this->registerService('OC_Defaults', function (ContainerInterface $c) { |
|
| 172 | + $this->registerService('OC_Defaults', function(ContainerInterface $c) { |
|
| 173 | 173 | return $c->get(IServerContainer::class)->getThemingDefaults(); |
| 174 | 174 | }); |
| 175 | 175 | |
| 176 | - $this->registerService('Protocol', function (ContainerInterface $c) { |
|
| 176 | + $this->registerService('Protocol', function(ContainerInterface $c) { |
|
| 177 | 177 | /** @var \OC\Server $server */ |
| 178 | 178 | $server = $c->get(IServerContainer::class); |
| 179 | 179 | $protocol = $server->getRequest()->getHttpProtocol(); |
| 180 | 180 | return new Http($_SERVER, $protocol); |
| 181 | 181 | }); |
| 182 | 182 | |
| 183 | - $this->registerService('Dispatcher', function (ContainerInterface $c) { |
|
| 183 | + $this->registerService('Dispatcher', function(ContainerInterface $c) { |
|
| 184 | 184 | return new Dispatcher( |
| 185 | 185 | $c->get('Protocol'), |
| 186 | 186 | $c->get(MiddlewareDispatcher::class), |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | * Middleware |
| 205 | 205 | */ |
| 206 | 206 | $this->registerAlias('MiddlewareDispatcher', MiddlewareDispatcher::class); |
| 207 | - $this->registerService(MiddlewareDispatcher::class, function (ContainerInterface $c) { |
|
| 207 | + $this->registerService(MiddlewareDispatcher::class, function(ContainerInterface $c) { |
|
| 208 | 208 | $server = $this->getServer(); |
| 209 | 209 | |
| 210 | 210 | $dispatcher = new MiddlewareDispatcher(); |
@@ -324,13 +324,13 @@ discard block |
||
| 324 | 324 | return $dispatcher; |
| 325 | 325 | }); |
| 326 | 326 | |
| 327 | - $this->registerService(IAppConfig::class, function (ContainerInterface $c) { |
|
| 327 | + $this->registerService(IAppConfig::class, function(ContainerInterface $c) { |
|
| 328 | 328 | return new OC\AppFramework\Services\AppConfig( |
| 329 | 329 | $c->get(IConfig::class), |
| 330 | 330 | $c->get('AppName') |
| 331 | 331 | ); |
| 332 | 332 | }); |
| 333 | - $this->registerService(IInitialState::class, function (ContainerInterface $c) { |
|
| 333 | + $this->registerService(IInitialState::class, function(ContainerInterface $c) { |
|
| 334 | 334 | return new OC\AppFramework\Services\InitialState( |
| 335 | 335 | $c->get(IInitialStateService::class), |
| 336 | 336 | $c->get('AppName') |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | * @param string $serviceName e.g. 'OCA\Files\Capabilities' |
| 419 | 419 | */ |
| 420 | 420 | public function registerCapability($serviceName) { |
| 421 | - $this->query('OC\CapabilitiesManager')->registerCapability(function () use ($serviceName) { |
|
| 421 | + $this->query('OC\CapabilitiesManager')->registerCapability(function() use ($serviceName) { |
|
| 422 | 422 | return $this->query($serviceName); |
| 423 | 423 | }); |
| 424 | 424 | } |
@@ -464,11 +464,11 @@ discard block |
||
| 464 | 464 | return parent::query($name); |
| 465 | 465 | } elseif ($this['AppName'] === 'core' && strpos($name, 'OC\\Core\\') === 0) { |
| 466 | 466 | return parent::query($name); |
| 467 | - } elseif (strpos($name, \OC\AppFramework\App::buildAppNamespace($this['AppName']) . '\\') === 0) { |
|
| 467 | + } elseif (strpos($name, \OC\AppFramework\App::buildAppNamespace($this['AppName']).'\\') === 0) { |
|
| 468 | 468 | return parent::query($name); |
| 469 | 469 | } |
| 470 | 470 | |
| 471 | - throw new QueryException('Could not resolve ' . $name . '!' . |
|
| 471 | + throw new QueryException('Could not resolve '.$name.'!'. |
|
| 472 | 472 | ' Class can not be instantiated', 1); |
| 473 | 473 | } |
| 474 | 474 | } |