@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * @param array $urlParams |
| 78 | 78 | * @param ServerContainer $server |
| 79 | 79 | */ |
| 80 | - public function __construct($appName, $urlParams = array(), ServerContainer $server = null){ |
|
| 80 | + public function __construct($appName, $urlParams = array(), ServerContainer $server = null) { |
|
| 81 | 81 | parent::__construct(); |
| 82 | 82 | $this['AppName'] = $appName; |
| 83 | 83 | $this['urlParams'] = $urlParams; |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | /** |
| 98 | 98 | * Core services |
| 99 | 99 | */ |
| 100 | - $this->registerService(IOutput::class, function($c){ |
|
| 100 | + $this->registerService(IOutput::class, function($c) { |
|
| 101 | 101 | return new Output($this->getServer()->getWebRoot()); |
| 102 | 102 | }); |
| 103 | 103 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | return $this->getServer()->getUserFolder(); |
| 106 | 106 | }); |
| 107 | 107 | |
| 108 | - $this->registerService(IAppData::class, function (SimpleContainer $c) { |
|
| 108 | + $this->registerService(IAppData::class, function(SimpleContainer $c) { |
|
| 109 | 109 | return $this->getServer()->getAppDataDir($c->query('AppName')); |
| 110 | 110 | }); |
| 111 | 111 | |
@@ -126,25 +126,25 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | $this->registerAlias(\OC\User\Session::class, \OCP\IUserSession::class); |
| 128 | 128 | |
| 129 | - $this->registerService(IServerContainer::class, function ($c) { |
|
| 129 | + $this->registerService(IServerContainer::class, function($c) { |
|
| 130 | 130 | return $this->getServer(); |
| 131 | 131 | }); |
| 132 | 132 | $this->registerAlias('ServerContainer', IServerContainer::class); |
| 133 | 133 | |
| 134 | - $this->registerService(\OCP\WorkflowEngine\IManager::class, function ($c) { |
|
| 134 | + $this->registerService(\OCP\WorkflowEngine\IManager::class, function($c) { |
|
| 135 | 135 | return $c->query('OCA\WorkflowEngine\Manager'); |
| 136 | 136 | }); |
| 137 | 137 | |
| 138 | - $this->registerService(\OCP\AppFramework\IAppContainer::class, function ($c) { |
|
| 138 | + $this->registerService(\OCP\AppFramework\IAppContainer::class, function($c) { |
|
| 139 | 139 | return $c; |
| 140 | 140 | }); |
| 141 | 141 | |
| 142 | 142 | // commonly used attributes |
| 143 | - $this->registerService('UserId', function ($c) { |
|
| 143 | + $this->registerService('UserId', function($c) { |
|
| 144 | 144 | return $c->query('OCP\\IUserSession')->getSession()->get('user_id'); |
| 145 | 145 | }); |
| 146 | 146 | |
| 147 | - $this->registerService('WebRoot', function ($c) { |
|
| 147 | + $this->registerService('WebRoot', function($c) { |
|
| 148 | 148 | return $c->query('ServerContainer')->getWebRoot(); |
| 149 | 149 | }); |
| 150 | 150 | |
@@ -152,15 +152,15 @@ discard block |
||
| 152 | 152 | return Util::getDefaultEmailAddress('no-reply'); |
| 153 | 153 | }); |
| 154 | 154 | |
| 155 | - $this->registerService('OC_Defaults', function ($c) { |
|
| 155 | + $this->registerService('OC_Defaults', function($c) { |
|
| 156 | 156 | return $c->getServer()->getThemingDefaults(); |
| 157 | 157 | }); |
| 158 | 158 | |
| 159 | - $this->registerService('OCP\Encryption\IManager', function ($c) { |
|
| 159 | + $this->registerService('OCP\Encryption\IManager', function($c) { |
|
| 160 | 160 | return $this->getServer()->getEncryptionManager(); |
| 161 | 161 | }); |
| 162 | 162 | |
| 163 | - $this->registerService(IConfig::class, function ($c) { |
|
| 163 | + $this->registerService(IConfig::class, function($c) { |
|
| 164 | 164 | return $c->query(OC\GlobalScale\Config::class); |
| 165 | 165 | }); |
| 166 | 166 | |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | return $c->query(Validator::class); |
| 169 | 169 | }); |
| 170 | 170 | |
| 171 | - $this->registerService(\OC\Security\IdentityProof\Manager::class, function ($c) { |
|
| 171 | + $this->registerService(\OC\Security\IdentityProof\Manager::class, function($c) { |
|
| 172 | 172 | return new \OC\Security\IdentityProof\Manager( |
| 173 | 173 | $this->getServer()->query(\OC\Files\AppData\Factory::class), |
| 174 | 174 | $this->getServer()->getCrypto(), |
@@ -179,15 +179,15 @@ discard block |
||
| 179 | 179 | /** |
| 180 | 180 | * App Framework APIs |
| 181 | 181 | */ |
| 182 | - $this->registerService('API', function($c){ |
|
| 182 | + $this->registerService('API', function($c) { |
|
| 183 | 183 | $c->query('OCP\\ILogger')->debug( |
| 184 | - 'Accessing the API class is deprecated! Use the appropriate ' . |
|
| 184 | + 'Accessing the API class is deprecated! Use the appropriate '. |
|
| 185 | 185 | 'services instead!' |
| 186 | 186 | ); |
| 187 | 187 | return new API($c['AppName']); |
| 188 | 188 | }); |
| 189 | 189 | |
| 190 | - $this->registerService('Protocol', function($c){ |
|
| 190 | + $this->registerService('Protocol', function($c) { |
|
| 191 | 191 | /** @var \OC\Server $server */ |
| 192 | 192 | $server = $c->query('ServerContainer'); |
| 193 | 193 | $protocol = $server->getRequest()->getHttpProtocol(); |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | ); |
| 276 | 276 | }); |
| 277 | 277 | |
| 278 | - $this->registerService('TwoFactorMiddleware', function (SimpleContainer $c) use ($app) { |
|
| 278 | + $this->registerService('TwoFactorMiddleware', function(SimpleContainer $c) use ($app) { |
|
| 279 | 279 | $twoFactorManager = $c->getServer()->getTwoFactorAuthManager(); |
| 280 | 280 | $userSession = $app->getServer()->getUserSession(); |
| 281 | 281 | $session = $app->getServer()->getSession(); |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | return new TwoFactorMiddleware($twoFactorManager, $userSession, $session, $urlGenerator, $reflector, $request); |
| 286 | 286 | }); |
| 287 | 287 | |
| 288 | - $this->registerService('OCSMiddleware', function (SimpleContainer $c) { |
|
| 288 | + $this->registerService('OCSMiddleware', function(SimpleContainer $c) { |
|
| 289 | 289 | return new OCSMiddleware( |
| 290 | 290 | $c['Request'] |
| 291 | 291 | ); |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | $dispatcher->registerMiddleware($c['BruteForceMiddleware']); |
| 302 | 302 | $dispatcher->registerMiddleware($c['RateLimitingMiddleware']); |
| 303 | 303 | |
| 304 | - foreach($middleWares as $middleWare) { |
|
| 304 | + foreach ($middleWares as $middleWare) { |
|
| 305 | 305 | $dispatcher->registerMiddleware($c[$middleWare]); |
| 306 | 306 | } |
| 307 | 307 | |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | * @return mixed |
| 374 | 374 | */ |
| 375 | 375 | public function log($message, $level) { |
| 376 | - switch($level){ |
|
| 376 | + switch ($level) { |
|
| 377 | 377 | case 'debug': |
| 378 | 378 | $level = \OCP\Util::DEBUG; |
| 379 | 379 | break; |
@@ -432,12 +432,12 @@ discard block |
||
| 432 | 432 | return parent::query($name); |
| 433 | 433 | } else if ($this['AppName'] === 'core' && strpos($name, 'OC\\Core\\') === 0) { |
| 434 | 434 | return parent::query($name); |
| 435 | - } else if (strpos($name, \OC\AppFramework\App::buildAppNamespace($this['AppName']) . '\\') === 0) { |
|
| 435 | + } else if (strpos($name, \OC\AppFramework\App::buildAppNamespace($this['AppName']).'\\') === 0) { |
|
| 436 | 436 | return parent::query($name); |
| 437 | 437 | } |
| 438 | 438 | } |
| 439 | 439 | |
| 440 | - throw new QueryException('Could not resolve ' . $name . '!' . |
|
| 440 | + throw new QueryException('Could not resolve '.$name.'!'. |
|
| 441 | 441 | ' Class can not be instantiated'); |
| 442 | 442 | } |
| 443 | 443 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | */ |
| 123 | 123 | public function getKey(IUser $user) { |
| 124 | 124 | $uid = $user->getUID(); |
| 125 | - return $this->retrieveKey('user-' . $uid); |
|
| 125 | + return $this->retrieveKey('user-'.$uid); |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | /** |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | if ($instanceId === null) { |
| 137 | 137 | throw new \RuntimeException('no instance id!'); |
| 138 | 138 | } |
| 139 | - return $this->retrieveKey('system-' . $instanceId); |
|
| 139 | + return $this->retrieveKey('system-'.$instanceId); |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | if ($instanceId === null) { |
| 61 | 61 | throw new \RuntimeException('no instance id!'); |
| 62 | 62 | } |
| 63 | - $this->identityProofDir = 'appdata_' . $instanceId . '/identityproof/'; |
|
| 63 | + $this->identityProofDir = 'appdata_'.$instanceId.'/identityproof/'; |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | $versionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0'); |
| 86 | 86 | if (version_compare($versionFromBeforeUpdate, '13.0.0.1', '<=')) { |
| 87 | 87 | $count = $this->repair(); |
| 88 | - $output->info('Repaired ' . $count . ' folders'); |
|
| 88 | + $output->info('Repaired '.$count.' folders'); |
|
| 89 | 89 | } |
| 90 | 90 | } |
| 91 | 91 | |
@@ -100,8 +100,8 @@ discard block |
||
| 100 | 100 | /** @var ISimpleFolder $folder */ |
| 101 | 101 | foreach ($dirListing as $folder) { |
| 102 | 102 | $name = $folder->getName(); |
| 103 | - $node = $this->rootFolder->get($this->identityProofDir . $name); |
|
| 104 | - $node->move($this->identityProofDir . 'user-' . $name); |
|
| 103 | + $node = $this->rootFolder->get($this->identityProofDir.$name); |
|
| 104 | + $node->move($this->identityProofDir.'user-'.$name); |
|
| 105 | 105 | $count++; |
| 106 | 106 | } |
| 107 | 107 | |