@@ -20,7 +20,7 @@ |
||
20 | 20 | */ |
21 | 21 | |
22 | 22 | |
23 | -require_once __DIR__ . '/../lib/base.php'; |
|
23 | +require_once __DIR__.'/../lib/base.php'; |
|
24 | 24 | |
25 | 25 | header('Content-Type: application/json'); |
26 | 26 |
@@ -6,39 +6,39 @@ |
||
6 | 6 | |
7 | 7 | class ComposerStaticInitFederatedFileSharing |
8 | 8 | { |
9 | - public static $prefixLengthsPsr4 = array ( |
|
9 | + public static $prefixLengthsPsr4 = array( |
|
10 | 10 | 'O' => |
11 | - array ( |
|
11 | + array( |
|
12 | 12 | 'OCA\\FederatedFileSharing\\' => 25, |
13 | 13 | ), |
14 | 14 | ); |
15 | 15 | |
16 | - public static $prefixDirsPsr4 = array ( |
|
16 | + public static $prefixDirsPsr4 = array( |
|
17 | 17 | 'OCA\\FederatedFileSharing\\' => |
18 | - array ( |
|
19 | - 0 => __DIR__ . '/..' . '/../lib', |
|
18 | + array( |
|
19 | + 0 => __DIR__.'/..'.'/../lib', |
|
20 | 20 | ), |
21 | 21 | ); |
22 | 22 | |
23 | - public static $classMap = array ( |
|
24 | - 'OCA\\FederatedFileSharing\\AddressHandler' => __DIR__ . '/..' . '/../lib/AddressHandler.php', |
|
25 | - 'OCA\\FederatedFileSharing\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php', |
|
26 | - 'OCA\\FederatedFileSharing\\BackgroundJob\\RetryJob' => __DIR__ . '/..' . '/../lib/BackgroundJob/RetryJob.php', |
|
27 | - 'OCA\\FederatedFileSharing\\Controller\\MountPublicLinkController' => __DIR__ . '/..' . '/../lib/Controller/MountPublicLinkController.php', |
|
28 | - 'OCA\\FederatedFileSharing\\Controller\\RequestHandlerController' => __DIR__ . '/..' . '/../lib/Controller/RequestHandlerController.php', |
|
29 | - 'OCA\\FederatedFileSharing\\FederatedShareProvider' => __DIR__ . '/..' . '/../lib/FederatedShareProvider.php', |
|
30 | - 'OCA\\FederatedFileSharing\\Notifications' => __DIR__ . '/..' . '/../lib/Notifications.php', |
|
31 | - 'OCA\\FederatedFileSharing\\Notifier' => __DIR__ . '/..' . '/../lib/Notifier.php', |
|
32 | - 'OCA\\FederatedFileSharing\\OCM\\CloudFederationProviderFiles' => __DIR__ . '/..' . '/../lib/ocm/CloudFederationProviderFiles.php', |
|
33 | - 'OCA\\FederatedFileSharing\\Settings\\Admin' => __DIR__ . '/..' . '/../lib/Settings/Admin.php', |
|
34 | - 'OCA\\FederatedFileSharing\\Settings\\Personal' => __DIR__ . '/..' . '/../lib/Settings/Personal.php', |
|
35 | - 'OCA\\FederatedFileSharing\\Settings\\PersonalSection' => __DIR__ . '/..' . '/../lib/Settings/PersonalSection.php', |
|
36 | - 'OCA\\FederatedFileSharing\\TokenHandler' => __DIR__ . '/..' . '/../lib/TokenHandler.php', |
|
23 | + public static $classMap = array( |
|
24 | + 'OCA\\FederatedFileSharing\\AddressHandler' => __DIR__.'/..'.'/../lib/AddressHandler.php', |
|
25 | + 'OCA\\FederatedFileSharing\\AppInfo\\Application' => __DIR__.'/..'.'/../lib/AppInfo/Application.php', |
|
26 | + 'OCA\\FederatedFileSharing\\BackgroundJob\\RetryJob' => __DIR__.'/..'.'/../lib/BackgroundJob/RetryJob.php', |
|
27 | + 'OCA\\FederatedFileSharing\\Controller\\MountPublicLinkController' => __DIR__.'/..'.'/../lib/Controller/MountPublicLinkController.php', |
|
28 | + 'OCA\\FederatedFileSharing\\Controller\\RequestHandlerController' => __DIR__.'/..'.'/../lib/Controller/RequestHandlerController.php', |
|
29 | + 'OCA\\FederatedFileSharing\\FederatedShareProvider' => __DIR__.'/..'.'/../lib/FederatedShareProvider.php', |
|
30 | + 'OCA\\FederatedFileSharing\\Notifications' => __DIR__.'/..'.'/../lib/Notifications.php', |
|
31 | + 'OCA\\FederatedFileSharing\\Notifier' => __DIR__.'/..'.'/../lib/Notifier.php', |
|
32 | + 'OCA\\FederatedFileSharing\\OCM\\CloudFederationProviderFiles' => __DIR__.'/..'.'/../lib/ocm/CloudFederationProviderFiles.php', |
|
33 | + 'OCA\\FederatedFileSharing\\Settings\\Admin' => __DIR__.'/..'.'/../lib/Settings/Admin.php', |
|
34 | + 'OCA\\FederatedFileSharing\\Settings\\Personal' => __DIR__.'/..'.'/../lib/Settings/Personal.php', |
|
35 | + 'OCA\\FederatedFileSharing\\Settings\\PersonalSection' => __DIR__.'/..'.'/../lib/Settings/PersonalSection.php', |
|
36 | + 'OCA\\FederatedFileSharing\\TokenHandler' => __DIR__.'/..'.'/../lib/TokenHandler.php', |
|
37 | 37 | ); |
38 | 38 | |
39 | 39 | public static function getInitializer(ClassLoader $loader) |
40 | 40 | { |
41 | - return \Closure::bind(function () use ($loader) { |
|
41 | + return \Closure::bind(function() use ($loader) { |
|
42 | 42 | $loader->prefixLengthsPsr4 = ComposerStaticInitFederatedFileSharing::$prefixLengthsPsr4; |
43 | 43 | $loader->prefixDirsPsr4 = ComposerStaticInitFederatedFileSharing::$prefixDirsPsr4; |
44 | 44 | $loader->classMap = ComposerStaticInitFederatedFileSharing::$classMap; |
@@ -6,17 +6,17 @@ |
||
6 | 6 | $baseDir = $vendorDir; |
7 | 7 | |
8 | 8 | return array( |
9 | - 'OCA\\FederatedFileSharing\\AddressHandler' => $baseDir . '/../lib/AddressHandler.php', |
|
10 | - 'OCA\\FederatedFileSharing\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php', |
|
11 | - 'OCA\\FederatedFileSharing\\BackgroundJob\\RetryJob' => $baseDir . '/../lib/BackgroundJob/RetryJob.php', |
|
12 | - 'OCA\\FederatedFileSharing\\Controller\\MountPublicLinkController' => $baseDir . '/../lib/Controller/MountPublicLinkController.php', |
|
13 | - 'OCA\\FederatedFileSharing\\Controller\\RequestHandlerController' => $baseDir . '/../lib/Controller/RequestHandlerController.php', |
|
14 | - 'OCA\\FederatedFileSharing\\FederatedShareProvider' => $baseDir . '/../lib/FederatedShareProvider.php', |
|
15 | - 'OCA\\FederatedFileSharing\\Notifications' => $baseDir . '/../lib/Notifications.php', |
|
16 | - 'OCA\\FederatedFileSharing\\Notifier' => $baseDir . '/../lib/Notifier.php', |
|
17 | - 'OCA\\FederatedFileSharing\\OCM\\CloudFederationProviderFiles' => $baseDir . '/../lib/ocm/CloudFederationProviderFiles.php', |
|
18 | - 'OCA\\FederatedFileSharing\\Settings\\Admin' => $baseDir . '/../lib/Settings/Admin.php', |
|
19 | - 'OCA\\FederatedFileSharing\\Settings\\Personal' => $baseDir . '/../lib/Settings/Personal.php', |
|
20 | - 'OCA\\FederatedFileSharing\\Settings\\PersonalSection' => $baseDir . '/../lib/Settings/PersonalSection.php', |
|
21 | - 'OCA\\FederatedFileSharing\\TokenHandler' => $baseDir . '/../lib/TokenHandler.php', |
|
9 | + 'OCA\\FederatedFileSharing\\AddressHandler' => $baseDir.'/../lib/AddressHandler.php', |
|
10 | + 'OCA\\FederatedFileSharing\\AppInfo\\Application' => $baseDir.'/../lib/AppInfo/Application.php', |
|
11 | + 'OCA\\FederatedFileSharing\\BackgroundJob\\RetryJob' => $baseDir.'/../lib/BackgroundJob/RetryJob.php', |
|
12 | + 'OCA\\FederatedFileSharing\\Controller\\MountPublicLinkController' => $baseDir.'/../lib/Controller/MountPublicLinkController.php', |
|
13 | + 'OCA\\FederatedFileSharing\\Controller\\RequestHandlerController' => $baseDir.'/../lib/Controller/RequestHandlerController.php', |
|
14 | + 'OCA\\FederatedFileSharing\\FederatedShareProvider' => $baseDir.'/../lib/FederatedShareProvider.php', |
|
15 | + 'OCA\\FederatedFileSharing\\Notifications' => $baseDir.'/../lib/Notifications.php', |
|
16 | + 'OCA\\FederatedFileSharing\\Notifier' => $baseDir.'/../lib/Notifier.php', |
|
17 | + 'OCA\\FederatedFileSharing\\OCM\\CloudFederationProviderFiles' => $baseDir.'/../lib/ocm/CloudFederationProviderFiles.php', |
|
18 | + 'OCA\\FederatedFileSharing\\Settings\\Admin' => $baseDir.'/../lib/Settings/Admin.php', |
|
19 | + 'OCA\\FederatedFileSharing\\Settings\\Personal' => $baseDir.'/../lib/Settings/Personal.php', |
|
20 | + 'OCA\\FederatedFileSharing\\Settings\\PersonalSection' => $baseDir.'/../lib/Settings/PersonalSection.php', |
|
21 | + 'OCA\\FederatedFileSharing\\TokenHandler' => $baseDir.'/../lib/TokenHandler.php', |
|
22 | 22 | ); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | */ |
33 | 33 | public function __construct($providerId) { |
34 | 34 | $l = \OC::$server->getL10N('federation'); |
35 | - $message = 'Cloud Federation Provider with ID: "' . $providerId . '" does not exist.'; |
|
35 | + $message = 'Cloud Federation Provider with ID: "'.$providerId.'" does not exist.'; |
|
36 | 36 | $hint = $l->t('Cloud Federation Provider with ID: "%s" does not exist.', [$providerId]); |
37 | 37 | parent::__construct($message, $hint); |
38 | 38 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | */ |
34 | 34 | public function __construct($newProviderId, $existingProviderName) { |
35 | 35 | $l = \OC::$server->getL10N('federation'); |
36 | - $message = 'Id "' . $newProviderId . '" already used by cloud federation provider "' . $existingProviderName . '"'; |
|
36 | + $message = 'Id "'.$newProviderId.'" already used by cloud federation provider "'.$existingProviderName.'"'; |
|
37 | 37 | $hint = $l->t('Id "%s" already used by cloud federation provider "%s"', [$newProviderId, $existingProviderName]); |
38 | 38 | parent::__construct($message, $hint); |
39 | 39 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $ocsStatus = isset($status['ocs']); |
118 | 118 | $ocsSuccess = $ocsStatus && ($status['ocs']['meta']['statuscode'] === 100 || $status['ocs']['meta']['statuscode'] === 200); |
119 | 119 | |
120 | - if ($result['success'] && (!$ocsStatus ||$ocsSuccess)) { |
|
120 | + if ($result['success'] && (!$ocsStatus || $ocsSuccess)) { |
|
121 | 121 | \OC_Hook::emit('OCP\Share', 'federated_share_added', ['server' => $remote]); |
122 | 122 | return true; |
123 | 123 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | 'remoteId' => $shareId |
150 | 150 | ); |
151 | 151 | |
152 | - $result = $this->tryHttpPostToShareEndpoint(rtrim($remote, '/'), '/' . $id . '/reshare', $fields); |
|
152 | + $result = $this->tryHttpPostToShareEndpoint(rtrim($remote, '/'), '/'.$id.'/reshare', $fields); |
|
153 | 153 | $status = json_decode($result['result'], true); |
154 | 154 | |
155 | 155 | $httpRequestSuccessful = $result['success']; |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | if ($httpRequestSuccessful && $ocsCallSuccessful && $validToken && $validRemoteId) { |
161 | 161 | return [ |
162 | 162 | $status['ocs']['data']['token'], |
163 | - (int)$status['ocs']['data']['remoteId'] |
|
163 | + (int) $status['ocs']['data']['remoteId'] |
|
164 | 164 | ]; |
165 | 165 | } |
166 | 166 | |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | $fields[$key] = $value; |
245 | 245 | } |
246 | 246 | |
247 | - $result = $this->tryHttpPostToShareEndpoint(rtrim($remote, '/'), '/' . $remoteId . '/' . $action, $fields); |
|
247 | + $result = $this->tryHttpPostToShareEndpoint(rtrim($remote, '/'), '/'.$remoteId.'/'.$action, $fields); |
|
248 | 248 | $status = json_decode($result['result'], true); |
249 | 249 | |
250 | 250 | if ($result['success'] && |
@@ -292,10 +292,10 @@ discard block |
||
292 | 292 | * @return array |
293 | 293 | * @throws \Exception |
294 | 294 | */ |
295 | - protected function tryHttpPostToShareEndpoint($remoteDomain, $urlSuffix, array $fields, $action="share") { |
|
295 | + protected function tryHttpPostToShareEndpoint($remoteDomain, $urlSuffix, array $fields, $action = "share") { |
|
296 | 296 | |
297 | 297 | if ($this->addressHandler->urlContainProtocol($remoteDomain) === false) { |
298 | - $remoteDomain = 'https://' . $remoteDomain; |
|
298 | + $remoteDomain = 'https://'.$remoteDomain; |
|
299 | 299 | } |
300 | 300 | |
301 | 301 | $result = [ |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | $federationEndpoints = $this->discoveryService->discover($remoteDomain, 'FEDERATED_SHARING'); |
316 | 316 | $endpoint = isset($federationEndpoints['share']) ? $federationEndpoints['share'] : '/ocs/v2.php/cloud/shares'; |
317 | 317 | try { |
318 | - $response = $client->post($remoteDomain . $endpoint . $urlSuffix . '?format=' . self::RESPONSE_FORMAT, [ |
|
318 | + $response = $client->post($remoteDomain.$endpoint.$urlSuffix.'?format='.self::RESPONSE_FORMAT, [ |
|
319 | 319 | 'body' => $fields, |
320 | 320 | 'timeout' => 10, |
321 | 321 | 'connect_timeout' => 10, |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | switch ($action) { |
372 | 372 | case 'share': |
373 | 373 | $share = $this->cloudFederationFactory->getCloudFederationShare( |
374 | - $fields['shareWith'] . '@' . $remoteDomain, |
|
374 | + $fields['shareWith'].'@'.$remoteDomain, |
|
375 | 375 | $fields['name'], |
376 | 376 | '', |
377 | 377 | $fields['remoteId'], |
@@ -131,18 +131,18 @@ discard block |
||
131 | 131 | * @param int $remoteId |
132 | 132 | * @return Mount|null |
133 | 133 | */ |
134 | - public function addShare($remote, $token, $password, $name, $owner, $accepted=false, $user = null, $remoteId = -1) { |
|
134 | + public function addShare($remote, $token, $password, $name, $owner, $accepted = false, $user = null, $remoteId = -1) { |
|
135 | 135 | |
136 | 136 | $user = $user ? $user : $this->uid; |
137 | 137 | $accepted = $accepted ? 1 : 0; |
138 | - $name = Filesystem::normalizePath('/' . $name); |
|
138 | + $name = Filesystem::normalizePath('/'.$name); |
|
139 | 139 | |
140 | 140 | if (!$accepted) { |
141 | 141 | // To avoid conflicts with the mount point generation later, |
142 | 142 | // we only use a temporary mount point name here. The real |
143 | 143 | // mount point name will be generated when accepting the share, |
144 | 144 | // using the original share item name. |
145 | - $tmpMountPointName = '{{TemporaryMountPointName#' . $name . '}}'; |
|
145 | + $tmpMountPointName = '{{TemporaryMountPointName#'.$name.'}}'; |
|
146 | 146 | $mountPoint = $tmpMountPointName; |
147 | 147 | $hash = md5($tmpMountPointName); |
148 | 148 | $data = [ |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | $i = 1; |
162 | 162 | while (!$this->connection->insertIfNotExist('*PREFIX*share_external', $data, ['user', 'mountpoint_hash'])) { |
163 | 163 | // The external share already exists for the user |
164 | - $data['mountpoint'] = $tmpMountPointName . '-' . $i; |
|
164 | + $data['mountpoint'] = $tmpMountPointName.'-'.$i; |
|
165 | 165 | $data['mountpoint_hash'] = md5($data['mountpoint']); |
166 | 166 | $i++; |
167 | 167 | } |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | } |
170 | 170 | |
171 | 171 | $mountPoint = Files::buildNotExistingFileName('/', $name); |
172 | - $mountPoint = Filesystem::normalizePath('/' . $mountPoint); |
|
172 | + $mountPoint = Filesystem::normalizePath('/'.$mountPoint); |
|
173 | 173 | $hash = md5($mountPoint); |
174 | 174 | |
175 | 175 | $query = $this->connection->prepare(' |
@@ -290,14 +290,14 @@ discard block |
||
290 | 290 | |
291 | 291 | $result = $this->tryOCMEndPoint($remote, $token, $remoteId, $feedback); |
292 | 292 | |
293 | - if($result === true) { |
|
293 | + if ($result === true) { |
|
294 | 294 | return true; |
295 | 295 | } |
296 | 296 | |
297 | 297 | $federationEndpoints = $this->discoveryService->discover($remote, 'FEDERATED_SHARING'); |
298 | 298 | $endpoint = isset($federationEndpoints['share']) ? $federationEndpoints['share'] : '/ocs/v2.php/cloud/shares'; |
299 | 299 | |
300 | - $url = rtrim($remote, '/') . $endpoint . '/' . $remoteId . '/' . $feedback . '?format=' . \OCP\Share::RESPONSE_FORMAT; |
|
300 | + $url = rtrim($remote, '/').$endpoint.'/'.$remoteId.'/'.$feedback.'?format='.\OCP\Share::RESPONSE_FORMAT; |
|
301 | 301 | $fields = array('token' => $token); |
302 | 302 | |
303 | 303 | $client = $this->clientService->newClient(); |
@@ -354,13 +354,13 @@ discard block |
||
354 | 354 | * @return string |
355 | 355 | */ |
356 | 356 | protected function stripPath($path) { |
357 | - $prefix = '/' . $this->uid . '/files'; |
|
357 | + $prefix = '/'.$this->uid.'/files'; |
|
358 | 358 | return rtrim(substr($path, strlen($prefix)), '/'); |
359 | 359 | } |
360 | 360 | |
361 | 361 | public function getMount($data) { |
362 | 362 | $data['manager'] = $this; |
363 | - $mountPoint = '/' . $this->uid . '/files' . $data['mountpoint']; |
|
363 | + $mountPoint = '/'.$this->uid.'/files'.$data['mountpoint']; |
|
364 | 364 | $data['mountpoint'] = $mountPoint; |
365 | 365 | $data['certificateManager'] = \OC::$server->getCertificateManager($this->uid); |
366 | 366 | return new Mount(self::STORAGE, $mountPoint, $data, $this, $this->storageLoader); |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | WHERE `mountpoint_hash` = ? |
401 | 401 | AND `user` = ? |
402 | 402 | '); |
403 | - $result = (bool)$query->execute(array($target, $targetHash, $sourceHash, $this->uid)); |
|
403 | + $result = (bool) $query->execute(array($target, $targetHash, $sourceHash, $this->uid)); |
|
404 | 404 | |
405 | 405 | return $result; |
406 | 406 | } |
@@ -435,9 +435,9 @@ discard block |
||
435 | 435 | WHERE `mountpoint_hash` = ? |
436 | 436 | AND `user` = ? |
437 | 437 | '); |
438 | - $result = (bool)$query->execute(array($hash, $this->uid)); |
|
438 | + $result = (bool) $query->execute(array($hash, $this->uid)); |
|
439 | 439 | |
440 | - if($result) { |
|
440 | + if ($result) { |
|
441 | 441 | $this->removeReShares($id); |
442 | 442 | } |
443 | 443 | |
@@ -458,7 +458,7 @@ discard block |
||
458 | 458 | |
459 | 459 | |
460 | 460 | $query->delete('federated_reshares') |
461 | - ->where($query->expr()->in('share_id', $query->createFunction('(' . $select . ')'))); |
|
461 | + ->where($query->expr()->in('share_id', $query->createFunction('('.$select.')'))); |
|
462 | 462 | $query->execute(); |
463 | 463 | |
464 | 464 | $deleteReShares = $this->connection->getQueryBuilder(); |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | |
483 | 483 | if ($result) { |
484 | 484 | $shares = $getShare->fetchAll(); |
485 | - foreach($shares as $share) { |
|
485 | + foreach ($shares as $share) { |
|
486 | 486 | $this->sendFeedbackToRemote($share['remote'], $share['share_token'], $share['remote_id'], 'decline'); |
487 | 487 | } |
488 | 488 | } |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | DELETE FROM `*PREFIX*share_external` |
492 | 492 | WHERE `user` = ? |
493 | 493 | '); |
494 | - return (bool)$query->execute(array($uid)); |
|
494 | + return (bool) $query->execute(array($uid)); |
|
495 | 495 | } |
496 | 496 | |
497 | 497 | /** |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | // To find out if we are running from CLI or not |
173 | 173 | $this->registerParameter('isCLI', \OC::$CLI); |
174 | 174 | |
175 | - $this->registerService(\OCP\IServerContainer::class, function (IServerContainer $c) { |
|
175 | + $this->registerService(\OCP\IServerContainer::class, function(IServerContainer $c) { |
|
176 | 176 | return $c; |
177 | 177 | }); |
178 | 178 | |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | $this->registerAlias(IActionFactory::class, ActionFactory::class); |
186 | 186 | |
187 | 187 | |
188 | - $this->registerService(\OCP\IPreview::class, function (Server $c) { |
|
188 | + $this->registerService(\OCP\IPreview::class, function(Server $c) { |
|
189 | 189 | return new PreviewManager( |
190 | 190 | $c->getConfig(), |
191 | 191 | $c->getRootFolder(), |
@@ -196,13 +196,13 @@ discard block |
||
196 | 196 | }); |
197 | 197 | $this->registerAlias('PreviewManager', \OCP\IPreview::class); |
198 | 198 | |
199 | - $this->registerService(\OC\Preview\Watcher::class, function (Server $c) { |
|
199 | + $this->registerService(\OC\Preview\Watcher::class, function(Server $c) { |
|
200 | 200 | return new \OC\Preview\Watcher( |
201 | 201 | $c->getAppDataDir('preview') |
202 | 202 | ); |
203 | 203 | }); |
204 | 204 | |
205 | - $this->registerService('EncryptionManager', function (Server $c) { |
|
205 | + $this->registerService('EncryptionManager', function(Server $c) { |
|
206 | 206 | $view = new View(); |
207 | 207 | $util = new Encryption\Util( |
208 | 208 | $view, |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | ); |
221 | 221 | }); |
222 | 222 | |
223 | - $this->registerService('EncryptionFileHelper', function (Server $c) { |
|
223 | + $this->registerService('EncryptionFileHelper', function(Server $c) { |
|
224 | 224 | $util = new Encryption\Util( |
225 | 225 | new View(), |
226 | 226 | $c->getUserManager(), |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | ); |
235 | 235 | }); |
236 | 236 | |
237 | - $this->registerService('EncryptionKeyStorage', function (Server $c) { |
|
237 | + $this->registerService('EncryptionKeyStorage', function(Server $c) { |
|
238 | 238 | $view = new View(); |
239 | 239 | $util = new Encryption\Util( |
240 | 240 | $view, |
@@ -245,30 +245,30 @@ discard block |
||
245 | 245 | |
246 | 246 | return new Encryption\Keys\Storage($view, $util); |
247 | 247 | }); |
248 | - $this->registerService('TagMapper', function (Server $c) { |
|
248 | + $this->registerService('TagMapper', function(Server $c) { |
|
249 | 249 | return new TagMapper($c->getDatabaseConnection()); |
250 | 250 | }); |
251 | 251 | |
252 | - $this->registerService(\OCP\ITagManager::class, function (Server $c) { |
|
252 | + $this->registerService(\OCP\ITagManager::class, function(Server $c) { |
|
253 | 253 | $tagMapper = $c->query('TagMapper'); |
254 | 254 | return new TagManager($tagMapper, $c->getUserSession()); |
255 | 255 | }); |
256 | 256 | $this->registerAlias('TagManager', \OCP\ITagManager::class); |
257 | 257 | |
258 | - $this->registerService('SystemTagManagerFactory', function (Server $c) { |
|
258 | + $this->registerService('SystemTagManagerFactory', function(Server $c) { |
|
259 | 259 | $config = $c->getConfig(); |
260 | 260 | $factoryClass = $config->getSystemValue('systemtags.managerFactory', SystemTagManagerFactory::class); |
261 | 261 | return new $factoryClass($this); |
262 | 262 | }); |
263 | - $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function (Server $c) { |
|
263 | + $this->registerService(\OCP\SystemTag\ISystemTagManager::class, function(Server $c) { |
|
264 | 264 | return $c->query('SystemTagManagerFactory')->getManager(); |
265 | 265 | }); |
266 | 266 | $this->registerAlias('SystemTagManager', \OCP\SystemTag\ISystemTagManager::class); |
267 | 267 | |
268 | - $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function (Server $c) { |
|
268 | + $this->registerService(\OCP\SystemTag\ISystemTagObjectMapper::class, function(Server $c) { |
|
269 | 269 | return $c->query('SystemTagManagerFactory')->getObjectMapper(); |
270 | 270 | }); |
271 | - $this->registerService('RootFolder', function (Server $c) { |
|
271 | + $this->registerService('RootFolder', function(Server $c) { |
|
272 | 272 | $manager = \OC\Files\Filesystem::getMountManager(null); |
273 | 273 | $view = new View(); |
274 | 274 | $root = new Root( |
@@ -289,38 +289,38 @@ discard block |
||
289 | 289 | }); |
290 | 290 | $this->registerAlias('SystemTagObjectMapper', \OCP\SystemTag\ISystemTagObjectMapper::class); |
291 | 291 | |
292 | - $this->registerService(\OCP\Files\IRootFolder::class, function (Server $c) { |
|
293 | - return new LazyRoot(function () use ($c) { |
|
292 | + $this->registerService(\OCP\Files\IRootFolder::class, function(Server $c) { |
|
293 | + return new LazyRoot(function() use ($c) { |
|
294 | 294 | return $c->query('RootFolder'); |
295 | 295 | }); |
296 | 296 | }); |
297 | 297 | $this->registerAlias('LazyRootFolder', \OCP\Files\IRootFolder::class); |
298 | 298 | |
299 | - $this->registerService(\OC\User\Manager::class, function (Server $c) { |
|
299 | + $this->registerService(\OC\User\Manager::class, function(Server $c) { |
|
300 | 300 | $config = $c->getConfig(); |
301 | 301 | return new \OC\User\Manager($config); |
302 | 302 | }); |
303 | 303 | $this->registerAlias('UserManager', \OC\User\Manager::class); |
304 | 304 | $this->registerAlias(\OCP\IUserManager::class, \OC\User\Manager::class); |
305 | 305 | |
306 | - $this->registerService(\OCP\IGroupManager::class, function (Server $c) { |
|
306 | + $this->registerService(\OCP\IGroupManager::class, function(Server $c) { |
|
307 | 307 | $groupManager = new \OC\Group\Manager($this->getUserManager(), $this->getLogger()); |
308 | - $groupManager->listen('\OC\Group', 'preCreate', function ($gid) { |
|
308 | + $groupManager->listen('\OC\Group', 'preCreate', function($gid) { |
|
309 | 309 | \OC_Hook::emit('OC_Group', 'pre_createGroup', array('run' => true, 'gid' => $gid)); |
310 | 310 | }); |
311 | - $groupManager->listen('\OC\Group', 'postCreate', function (\OC\Group\Group $gid) { |
|
311 | + $groupManager->listen('\OC\Group', 'postCreate', function(\OC\Group\Group $gid) { |
|
312 | 312 | \OC_Hook::emit('OC_User', 'post_createGroup', array('gid' => $gid->getGID())); |
313 | 313 | }); |
314 | - $groupManager->listen('\OC\Group', 'preDelete', function (\OC\Group\Group $group) { |
|
314 | + $groupManager->listen('\OC\Group', 'preDelete', function(\OC\Group\Group $group) { |
|
315 | 315 | \OC_Hook::emit('OC_Group', 'pre_deleteGroup', array('run' => true, 'gid' => $group->getGID())); |
316 | 316 | }); |
317 | - $groupManager->listen('\OC\Group', 'postDelete', function (\OC\Group\Group $group) { |
|
317 | + $groupManager->listen('\OC\Group', 'postDelete', function(\OC\Group\Group $group) { |
|
318 | 318 | \OC_Hook::emit('OC_User', 'post_deleteGroup', array('gid' => $group->getGID())); |
319 | 319 | }); |
320 | - $groupManager->listen('\OC\Group', 'preAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
320 | + $groupManager->listen('\OC\Group', 'preAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
321 | 321 | \OC_Hook::emit('OC_Group', 'pre_addToGroup', array('run' => true, 'uid' => $user->getUID(), 'gid' => $group->getGID())); |
322 | 322 | }); |
323 | - $groupManager->listen('\OC\Group', 'postAddUser', function (\OC\Group\Group $group, \OC\User\User $user) { |
|
323 | + $groupManager->listen('\OC\Group', 'postAddUser', function(\OC\Group\Group $group, \OC\User\User $user) { |
|
324 | 324 | \OC_Hook::emit('OC_Group', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
325 | 325 | //Minimal fix to keep it backward compatible TODO: clean up all the GroupManager hooks |
326 | 326 | \OC_Hook::emit('OC_User', 'post_addToGroup', array('uid' => $user->getUID(), 'gid' => $group->getGID())); |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | }); |
330 | 330 | $this->registerAlias('GroupManager', \OCP\IGroupManager::class); |
331 | 331 | |
332 | - $this->registerService(Store::class, function (Server $c) { |
|
332 | + $this->registerService(Store::class, function(Server $c) { |
|
333 | 333 | $session = $c->getSession(); |
334 | 334 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
335 | 335 | $tokenProvider = $c->query(IProvider::class); |
@@ -340,11 +340,11 @@ discard block |
||
340 | 340 | return new Store($session, $logger, $tokenProvider); |
341 | 341 | }); |
342 | 342 | $this->registerAlias(IStore::class, Store::class); |
343 | - $this->registerService(Authentication\Token\DefaultTokenMapper::class, function (Server $c) { |
|
343 | + $this->registerService(Authentication\Token\DefaultTokenMapper::class, function(Server $c) { |
|
344 | 344 | $dbConnection = $c->getDatabaseConnection(); |
345 | 345 | return new Authentication\Token\DefaultTokenMapper($dbConnection); |
346 | 346 | }); |
347 | - $this->registerService(Authentication\Token\DefaultTokenProvider::class, function (Server $c) { |
|
347 | + $this->registerService(Authentication\Token\DefaultTokenProvider::class, function(Server $c) { |
|
348 | 348 | $mapper = $c->query(Authentication\Token\DefaultTokenMapper::class); |
349 | 349 | $crypto = $c->getCrypto(); |
350 | 350 | $config = $c->getConfig(); |
@@ -354,7 +354,7 @@ discard block |
||
354 | 354 | }); |
355 | 355 | $this->registerAlias(IProvider::class, Authentication\Token\DefaultTokenProvider::class); |
356 | 356 | |
357 | - $this->registerService(\OCP\IUserSession::class, function (Server $c) { |
|
357 | + $this->registerService(\OCP\IUserSession::class, function(Server $c) { |
|
358 | 358 | $manager = $c->getUserManager(); |
359 | 359 | $session = new \OC\Session\Memory(''); |
360 | 360 | $timeFactory = new TimeFactory(); |
@@ -378,45 +378,45 @@ discard block |
||
378 | 378 | $c->getLockdownManager(), |
379 | 379 | $c->getLogger() |
380 | 380 | ); |
381 | - $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
381 | + $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
382 | 382 | \OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password)); |
383 | 383 | }); |
384 | - $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
384 | + $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
385 | 385 | /** @var $user \OC\User\User */ |
386 | 386 | \OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password)); |
387 | 387 | }); |
388 | - $userSession->listen('\OC\User', 'preDelete', function ($user) use ($dispatcher) { |
|
388 | + $userSession->listen('\OC\User', 'preDelete', function($user) use ($dispatcher) { |
|
389 | 389 | /** @var $user \OC\User\User */ |
390 | 390 | \OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID())); |
391 | 391 | $dispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user)); |
392 | 392 | }); |
393 | - $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
393 | + $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
394 | 394 | /** @var $user \OC\User\User */ |
395 | 395 | \OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID())); |
396 | 396 | }); |
397 | - $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
397 | + $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
398 | 398 | /** @var $user \OC\User\User */ |
399 | 399 | \OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
400 | 400 | }); |
401 | - $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
401 | + $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
402 | 402 | /** @var $user \OC\User\User */ |
403 | 403 | \OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
404 | 404 | }); |
405 | - $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
405 | + $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
406 | 406 | \OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password)); |
407 | 407 | }); |
408 | - $userSession->listen('\OC\User', 'postLogin', function ($user, $password) { |
|
408 | + $userSession->listen('\OC\User', 'postLogin', function($user, $password) { |
|
409 | 409 | /** @var $user \OC\User\User */ |
410 | 410 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
411 | 411 | }); |
412 | - $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
|
412 | + $userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) { |
|
413 | 413 | /** @var $user \OC\User\User */ |
414 | 414 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
415 | 415 | }); |
416 | - $userSession->listen('\OC\User', 'logout', function () { |
|
416 | + $userSession->listen('\OC\User', 'logout', function() { |
|
417 | 417 | \OC_Hook::emit('OC_User', 'logout', array()); |
418 | 418 | }); |
419 | - $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) use ($dispatcher) { |
|
419 | + $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) use ($dispatcher) { |
|
420 | 420 | /** @var $user \OC\User\User */ |
421 | 421 | \OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue)); |
422 | 422 | $dispatcher->dispatch('OCP\IUser::changeUser', new GenericEvent($user, ['feature' => $feature, 'oldValue' => $oldValue, 'value' => $value])); |
@@ -425,7 +425,7 @@ discard block |
||
425 | 425 | }); |
426 | 426 | $this->registerAlias('UserSession', \OCP\IUserSession::class); |
427 | 427 | |
428 | - $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function (Server $c) { |
|
428 | + $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function(Server $c) { |
|
429 | 429 | return new \OC\Authentication\TwoFactorAuth\Manager( |
430 | 430 | $c->getAppManager(), |
431 | 431 | $c->getSession(), |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | $this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class); |
442 | 442 | $this->registerAlias('NavigationManager', \OCP\INavigationManager::class); |
443 | 443 | |
444 | - $this->registerService(\OC\AllConfig::class, function (Server $c) { |
|
444 | + $this->registerService(\OC\AllConfig::class, function(Server $c) { |
|
445 | 445 | return new \OC\AllConfig( |
446 | 446 | $c->getSystemConfig() |
447 | 447 | ); |
@@ -449,17 +449,17 @@ discard block |
||
449 | 449 | $this->registerAlias('AllConfig', \OC\AllConfig::class); |
450 | 450 | $this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
451 | 451 | |
452 | - $this->registerService('SystemConfig', function ($c) use ($config) { |
|
452 | + $this->registerService('SystemConfig', function($c) use ($config) { |
|
453 | 453 | return new \OC\SystemConfig($config); |
454 | 454 | }); |
455 | 455 | |
456 | - $this->registerService(\OC\AppConfig::class, function (Server $c) { |
|
456 | + $this->registerService(\OC\AppConfig::class, function(Server $c) { |
|
457 | 457 | return new \OC\AppConfig($c->getDatabaseConnection()); |
458 | 458 | }); |
459 | 459 | $this->registerAlias('AppConfig', \OC\AppConfig::class); |
460 | 460 | $this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class); |
461 | 461 | |
462 | - $this->registerService(\OCP\L10N\IFactory::class, function (Server $c) { |
|
462 | + $this->registerService(\OCP\L10N\IFactory::class, function(Server $c) { |
|
463 | 463 | return new \OC\L10N\Factory( |
464 | 464 | $c->getConfig(), |
465 | 465 | $c->getRequest(), |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | }); |
470 | 470 | $this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class); |
471 | 471 | |
472 | - $this->registerService(\OCP\IURLGenerator::class, function (Server $c) { |
|
472 | + $this->registerService(\OCP\IURLGenerator::class, function(Server $c) { |
|
473 | 473 | $config = $c->getConfig(); |
474 | 474 | $cacheFactory = $c->getMemCacheFactory(); |
475 | 475 | $request = $c->getRequest(); |
@@ -484,12 +484,12 @@ discard block |
||
484 | 484 | $this->registerAlias('AppFetcher', AppFetcher::class); |
485 | 485 | $this->registerAlias('CategoryFetcher', CategoryFetcher::class); |
486 | 486 | |
487 | - $this->registerService(\OCP\ICache::class, function ($c) { |
|
487 | + $this->registerService(\OCP\ICache::class, function($c) { |
|
488 | 488 | return new Cache\File(); |
489 | 489 | }); |
490 | 490 | $this->registerAlias('UserCache', \OCP\ICache::class); |
491 | 491 | |
492 | - $this->registerService(Factory::class, function (Server $c) { |
|
492 | + $this->registerService(Factory::class, function(Server $c) { |
|
493 | 493 | |
494 | 494 | $arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(), |
495 | 495 | ArrayCache::class, |
@@ -506,7 +506,7 @@ discard block |
||
506 | 506 | $version = implode(',', $v); |
507 | 507 | $instanceId = \OC_Util::getInstanceId(); |
508 | 508 | $path = \OC::$SERVERROOT; |
509 | - $prefix = md5($instanceId . '-' . $version . '-' . $path); |
|
509 | + $prefix = md5($instanceId.'-'.$version.'-'.$path); |
|
510 | 510 | return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
511 | 511 | $config->getSystemValue('memcache.local', null), |
512 | 512 | $config->getSystemValue('memcache.distributed', null), |
@@ -519,12 +519,12 @@ discard block |
||
519 | 519 | $this->registerAlias('MemCacheFactory', Factory::class); |
520 | 520 | $this->registerAlias(ICacheFactory::class, Factory::class); |
521 | 521 | |
522 | - $this->registerService('RedisFactory', function (Server $c) { |
|
522 | + $this->registerService('RedisFactory', function(Server $c) { |
|
523 | 523 | $systemConfig = $c->getSystemConfig(); |
524 | 524 | return new RedisFactory($systemConfig); |
525 | 525 | }); |
526 | 526 | |
527 | - $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
527 | + $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
528 | 528 | return new \OC\Activity\Manager( |
529 | 529 | $c->getRequest(), |
530 | 530 | $c->getUserSession(), |
@@ -534,14 +534,14 @@ discard block |
||
534 | 534 | }); |
535 | 535 | $this->registerAlias('ActivityManager', \OCP\Activity\IManager::class); |
536 | 536 | |
537 | - $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
537 | + $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
538 | 538 | return new \OC\Activity\EventMerger( |
539 | 539 | $c->getL10N('lib') |
540 | 540 | ); |
541 | 541 | }); |
542 | 542 | $this->registerAlias(IValidator::class, Validator::class); |
543 | 543 | |
544 | - $this->registerService(\OCP\IAvatarManager::class, function (Server $c) { |
|
544 | + $this->registerService(\OCP\IAvatarManager::class, function(Server $c) { |
|
545 | 545 | return new AvatarManager( |
546 | 546 | $c->query(\OC\User\Manager::class), |
547 | 547 | $c->getAppDataDir('avatar'), |
@@ -554,7 +554,7 @@ discard block |
||
554 | 554 | |
555 | 555 | $this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class); |
556 | 556 | |
557 | - $this->registerService(\OCP\ILogger::class, function (Server $c) { |
|
557 | + $this->registerService(\OCP\ILogger::class, function(Server $c) { |
|
558 | 558 | $logType = $c->query('AllConfig')->getSystemValue('log_type', 'file'); |
559 | 559 | $factory = new LogFactory($c, $this->getSystemConfig()); |
560 | 560 | $logger = $factory->get($logType); |
@@ -564,11 +564,11 @@ discard block |
||
564 | 564 | }); |
565 | 565 | $this->registerAlias('Logger', \OCP\ILogger::class); |
566 | 566 | |
567 | - $this->registerService(ILogFactory::class, function (Server $c) { |
|
567 | + $this->registerService(ILogFactory::class, function(Server $c) { |
|
568 | 568 | return new LogFactory($c, $this->getSystemConfig()); |
569 | 569 | }); |
570 | 570 | |
571 | - $this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) { |
|
571 | + $this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) { |
|
572 | 572 | $config = $c->getConfig(); |
573 | 573 | return new \OC\BackgroundJob\JobList( |
574 | 574 | $c->getDatabaseConnection(), |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | }); |
579 | 579 | $this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class); |
580 | 580 | |
581 | - $this->registerService(\OCP\Route\IRouter::class, function (Server $c) { |
|
581 | + $this->registerService(\OCP\Route\IRouter::class, function(Server $c) { |
|
582 | 582 | $cacheFactory = $c->getMemCacheFactory(); |
583 | 583 | $logger = $c->getLogger(); |
584 | 584 | if ($cacheFactory->isLocalCacheAvailable()) { |
@@ -590,12 +590,12 @@ discard block |
||
590 | 590 | }); |
591 | 591 | $this->registerAlias('Router', \OCP\Route\IRouter::class); |
592 | 592 | |
593 | - $this->registerService(\OCP\ISearch::class, function ($c) { |
|
593 | + $this->registerService(\OCP\ISearch::class, function($c) { |
|
594 | 594 | return new Search(); |
595 | 595 | }); |
596 | 596 | $this->registerAlias('Search', \OCP\ISearch::class); |
597 | 597 | |
598 | - $this->registerService(\OC\Security\RateLimiting\Limiter::class, function (Server $c) { |
|
598 | + $this->registerService(\OC\Security\RateLimiting\Limiter::class, function(Server $c) { |
|
599 | 599 | return new \OC\Security\RateLimiting\Limiter( |
600 | 600 | $this->getUserSession(), |
601 | 601 | $this->getRequest(), |
@@ -603,34 +603,34 @@ discard block |
||
603 | 603 | $c->query(\OC\Security\RateLimiting\Backend\IBackend::class) |
604 | 604 | ); |
605 | 605 | }); |
606 | - $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { |
|
606 | + $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) { |
|
607 | 607 | return new \OC\Security\RateLimiting\Backend\MemoryCache( |
608 | 608 | $this->getMemCacheFactory(), |
609 | 609 | new \OC\AppFramework\Utility\TimeFactory() |
610 | 610 | ); |
611 | 611 | }); |
612 | 612 | |
613 | - $this->registerService(\OCP\Security\ISecureRandom::class, function ($c) { |
|
613 | + $this->registerService(\OCP\Security\ISecureRandom::class, function($c) { |
|
614 | 614 | return new SecureRandom(); |
615 | 615 | }); |
616 | 616 | $this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class); |
617 | 617 | |
618 | - $this->registerService(\OCP\Security\ICrypto::class, function (Server $c) { |
|
618 | + $this->registerService(\OCP\Security\ICrypto::class, function(Server $c) { |
|
619 | 619 | return new Crypto($c->getConfig(), $c->getSecureRandom()); |
620 | 620 | }); |
621 | 621 | $this->registerAlias('Crypto', \OCP\Security\ICrypto::class); |
622 | 622 | |
623 | - $this->registerService(\OCP\Security\IHasher::class, function (Server $c) { |
|
623 | + $this->registerService(\OCP\Security\IHasher::class, function(Server $c) { |
|
624 | 624 | return new Hasher($c->getConfig()); |
625 | 625 | }); |
626 | 626 | $this->registerAlias('Hasher', \OCP\Security\IHasher::class); |
627 | 627 | |
628 | - $this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) { |
|
628 | + $this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) { |
|
629 | 629 | return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection()); |
630 | 630 | }); |
631 | 631 | $this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class); |
632 | 632 | |
633 | - $this->registerService(IDBConnection::class, function (Server $c) { |
|
633 | + $this->registerService(IDBConnection::class, function(Server $c) { |
|
634 | 634 | $systemConfig = $c->getSystemConfig(); |
635 | 635 | $factory = new \OC\DB\ConnectionFactory($systemConfig); |
636 | 636 | $type = $systemConfig->getValue('dbtype', 'sqlite'); |
@@ -645,7 +645,7 @@ discard block |
||
645 | 645 | $this->registerAlias('DatabaseConnection', IDBConnection::class); |
646 | 646 | |
647 | 647 | |
648 | - $this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) { |
|
648 | + $this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) { |
|
649 | 649 | $user = \OC_User::getUser(); |
650 | 650 | $uid = $user ? $user : null; |
651 | 651 | return new ClientService( |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | ); |
661 | 661 | }); |
662 | 662 | $this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class); |
663 | - $this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) { |
|
663 | + $this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) { |
|
664 | 664 | $eventLogger = new EventLogger(); |
665 | 665 | if ($c->getSystemConfig()->getValue('debug', false)) { |
666 | 666 | // In debug mode, module is being activated by default |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | }); |
671 | 671 | $this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class); |
672 | 672 | |
673 | - $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) { |
|
673 | + $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) { |
|
674 | 674 | $queryLogger = new QueryLogger(); |
675 | 675 | if ($c->getSystemConfig()->getValue('debug', false)) { |
676 | 676 | // In debug mode, module is being activated by default |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | }); |
681 | 681 | $this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class); |
682 | 682 | |
683 | - $this->registerService(TempManager::class, function (Server $c) { |
|
683 | + $this->registerService(TempManager::class, function(Server $c) { |
|
684 | 684 | return new TempManager( |
685 | 685 | $c->getLogger(), |
686 | 686 | $c->getConfig() |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | $this->registerAlias('TempManager', TempManager::class); |
690 | 690 | $this->registerAlias(ITempManager::class, TempManager::class); |
691 | 691 | |
692 | - $this->registerService(AppManager::class, function (Server $c) { |
|
692 | + $this->registerService(AppManager::class, function(Server $c) { |
|
693 | 693 | return new \OC\App\AppManager( |
694 | 694 | $c->getUserSession(), |
695 | 695 | $c->query(\OC\AppConfig::class), |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | $this->registerAlias('AppManager', AppManager::class); |
702 | 702 | $this->registerAlias(IAppManager::class, AppManager::class); |
703 | 703 | |
704 | - $this->registerService(\OCP\IDateTimeZone::class, function (Server $c) { |
|
704 | + $this->registerService(\OCP\IDateTimeZone::class, function(Server $c) { |
|
705 | 705 | return new DateTimeZone( |
706 | 706 | $c->getConfig(), |
707 | 707 | $c->getSession() |
@@ -709,7 +709,7 @@ discard block |
||
709 | 709 | }); |
710 | 710 | $this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class); |
711 | 711 | |
712 | - $this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) { |
|
712 | + $this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) { |
|
713 | 713 | $language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
714 | 714 | |
715 | 715 | return new DateTimeFormatter( |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | }); |
720 | 720 | $this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class); |
721 | 721 | |
722 | - $this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) { |
|
722 | + $this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) { |
|
723 | 723 | $mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
724 | 724 | $listener = new UserMountCacheListener($mountCache); |
725 | 725 | $listener->listen($c->getUserManager()); |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | }); |
728 | 728 | $this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class); |
729 | 729 | |
730 | - $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) { |
|
730 | + $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) { |
|
731 | 731 | $loader = \OC\Files\Filesystem::getLoader(); |
732 | 732 | $mountCache = $c->query('UserMountCache'); |
733 | 733 | $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
@@ -743,10 +743,10 @@ discard block |
||
743 | 743 | }); |
744 | 744 | $this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class); |
745 | 745 | |
746 | - $this->registerService('IniWrapper', function ($c) { |
|
746 | + $this->registerService('IniWrapper', function($c) { |
|
747 | 747 | return new IniGetWrapper(); |
748 | 748 | }); |
749 | - $this->registerService('AsyncCommandBus', function (Server $c) { |
|
749 | + $this->registerService('AsyncCommandBus', function(Server $c) { |
|
750 | 750 | $busClass = $c->getConfig()->getSystemValue('commandbus'); |
751 | 751 | if ($busClass) { |
752 | 752 | list($app, $class) = explode('::', $busClass, 2); |
@@ -761,10 +761,10 @@ discard block |
||
761 | 761 | return new CronBus($jobList); |
762 | 762 | } |
763 | 763 | }); |
764 | - $this->registerService('TrustedDomainHelper', function ($c) { |
|
764 | + $this->registerService('TrustedDomainHelper', function($c) { |
|
765 | 765 | return new TrustedDomainHelper($this->getConfig()); |
766 | 766 | }); |
767 | - $this->registerService('Throttler', function (Server $c) { |
|
767 | + $this->registerService('Throttler', function(Server $c) { |
|
768 | 768 | return new Throttler( |
769 | 769 | $c->getDatabaseConnection(), |
770 | 770 | new TimeFactory(), |
@@ -772,7 +772,7 @@ discard block |
||
772 | 772 | $c->getConfig() |
773 | 773 | ); |
774 | 774 | }); |
775 | - $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
775 | + $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
776 | 776 | // IConfig and IAppManager requires a working database. This code |
777 | 777 | // might however be called when ownCloud is not yet setup. |
778 | 778 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
@@ -793,7 +793,7 @@ discard block |
||
793 | 793 | $c->getTempManager() |
794 | 794 | ); |
795 | 795 | }); |
796 | - $this->registerService(\OCP\IRequest::class, function ($c) { |
|
796 | + $this->registerService(\OCP\IRequest::class, function($c) { |
|
797 | 797 | if (isset($this['urlParams'])) { |
798 | 798 | $urlParams = $this['urlParams']; |
799 | 799 | } else { |
@@ -829,7 +829,7 @@ discard block |
||
829 | 829 | }); |
830 | 830 | $this->registerAlias('Request', \OCP\IRequest::class); |
831 | 831 | |
832 | - $this->registerService(\OCP\Mail\IMailer::class, function (Server $c) { |
|
832 | + $this->registerService(\OCP\Mail\IMailer::class, function(Server $c) { |
|
833 | 833 | return new Mailer( |
834 | 834 | $c->getConfig(), |
835 | 835 | $c->getLogger(), |
@@ -840,7 +840,7 @@ discard block |
||
840 | 840 | }); |
841 | 841 | $this->registerAlias('Mailer', \OCP\Mail\IMailer::class); |
842 | 842 | |
843 | - $this->registerService('LDAPProvider', function (Server $c) { |
|
843 | + $this->registerService('LDAPProvider', function(Server $c) { |
|
844 | 844 | $config = $c->getConfig(); |
845 | 845 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
846 | 846 | if (is_null($factoryClass)) { |
@@ -850,7 +850,7 @@ discard block |
||
850 | 850 | $factory = new $factoryClass($this); |
851 | 851 | return $factory->getLDAPProvider(); |
852 | 852 | }); |
853 | - $this->registerService(ILockingProvider::class, function (Server $c) { |
|
853 | + $this->registerService(ILockingProvider::class, function(Server $c) { |
|
854 | 854 | $ini = $c->getIniWrapper(); |
855 | 855 | $config = $c->getConfig(); |
856 | 856 | $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
@@ -873,49 +873,49 @@ discard block |
||
873 | 873 | }); |
874 | 874 | $this->registerAlias('LockingProvider', ILockingProvider::class); |
875 | 875 | |
876 | - $this->registerService(\OCP\Files\Mount\IMountManager::class, function () { |
|
876 | + $this->registerService(\OCP\Files\Mount\IMountManager::class, function() { |
|
877 | 877 | return new \OC\Files\Mount\Manager(); |
878 | 878 | }); |
879 | 879 | $this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class); |
880 | 880 | |
881 | - $this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) { |
|
881 | + $this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) { |
|
882 | 882 | return new \OC\Files\Type\Detection( |
883 | 883 | $c->getURLGenerator(), |
884 | 884 | \OC::$configDir, |
885 | - \OC::$SERVERROOT . '/resources/config/' |
|
885 | + \OC::$SERVERROOT.'/resources/config/' |
|
886 | 886 | ); |
887 | 887 | }); |
888 | 888 | $this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class); |
889 | 889 | |
890 | - $this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) { |
|
890 | + $this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) { |
|
891 | 891 | return new \OC\Files\Type\Loader( |
892 | 892 | $c->getDatabaseConnection() |
893 | 893 | ); |
894 | 894 | }); |
895 | 895 | $this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class); |
896 | - $this->registerService(BundleFetcher::class, function () { |
|
896 | + $this->registerService(BundleFetcher::class, function() { |
|
897 | 897 | return new BundleFetcher($this->getL10N('lib')); |
898 | 898 | }); |
899 | - $this->registerService(\OCP\Notification\IManager::class, function (Server $c) { |
|
899 | + $this->registerService(\OCP\Notification\IManager::class, function(Server $c) { |
|
900 | 900 | return new Manager( |
901 | 901 | $c->query(IValidator::class) |
902 | 902 | ); |
903 | 903 | }); |
904 | 904 | $this->registerAlias('NotificationManager', \OCP\Notification\IManager::class); |
905 | 905 | |
906 | - $this->registerService(\OC\CapabilitiesManager::class, function (Server $c) { |
|
906 | + $this->registerService(\OC\CapabilitiesManager::class, function(Server $c) { |
|
907 | 907 | $manager = new \OC\CapabilitiesManager($c->getLogger()); |
908 | - $manager->registerCapability(function () use ($c) { |
|
908 | + $manager->registerCapability(function() use ($c) { |
|
909 | 909 | return new \OC\OCS\CoreCapabilities($c->getConfig()); |
910 | 910 | }); |
911 | - $manager->registerCapability(function () use ($c) { |
|
911 | + $manager->registerCapability(function() use ($c) { |
|
912 | 912 | return $c->query(\OC\Security\Bruteforce\Capabilities::class); |
913 | 913 | }); |
914 | 914 | return $manager; |
915 | 915 | }); |
916 | 916 | $this->registerAlias('CapabilitiesManager', \OC\CapabilitiesManager::class); |
917 | 917 | |
918 | - $this->registerService(\OCP\Comments\ICommentsManager::class, function (Server $c) { |
|
918 | + $this->registerService(\OCP\Comments\ICommentsManager::class, function(Server $c) { |
|
919 | 919 | $config = $c->getConfig(); |
920 | 920 | $factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class); |
921 | 921 | /** @var \OCP\Comments\ICommentsManagerFactory $factory */ |
@@ -925,7 +925,7 @@ discard block |
||
925 | 925 | $manager->registerDisplayNameResolver('user', function($id) use ($c) { |
926 | 926 | $manager = $c->getUserManager(); |
927 | 927 | $user = $manager->get($id); |
928 | - if(is_null($user)) { |
|
928 | + if (is_null($user)) { |
|
929 | 929 | $l = $c->getL10N('core'); |
930 | 930 | $displayName = $l->t('Unknown user'); |
931 | 931 | } else { |
@@ -938,7 +938,7 @@ discard block |
||
938 | 938 | }); |
939 | 939 | $this->registerAlias('CommentsManager', \OCP\Comments\ICommentsManager::class); |
940 | 940 | |
941 | - $this->registerService('ThemingDefaults', function (Server $c) { |
|
941 | + $this->registerService('ThemingDefaults', function(Server $c) { |
|
942 | 942 | /* |
943 | 943 | * Dark magic for autoloader. |
944 | 944 | * If we do a class_exists it will try to load the class which will |
@@ -965,7 +965,7 @@ discard block |
||
965 | 965 | } |
966 | 966 | return new \OC_Defaults(); |
967 | 967 | }); |
968 | - $this->registerService(SCSSCacher::class, function (Server $c) { |
|
968 | + $this->registerService(SCSSCacher::class, function(Server $c) { |
|
969 | 969 | /** @var Factory $cacheFactory */ |
970 | 970 | $cacheFactory = $c->query(Factory::class); |
971 | 971 | return new SCSSCacher( |
@@ -978,7 +978,7 @@ discard block |
||
978 | 978 | $this->getMemCacheFactory() |
979 | 979 | ); |
980 | 980 | }); |
981 | - $this->registerService(JSCombiner::class, function (Server $c) { |
|
981 | + $this->registerService(JSCombiner::class, function(Server $c) { |
|
982 | 982 | /** @var Factory $cacheFactory */ |
983 | 983 | $cacheFactory = $c->query(Factory::class); |
984 | 984 | return new JSCombiner( |
@@ -989,13 +989,13 @@ discard block |
||
989 | 989 | $c->getLogger() |
990 | 990 | ); |
991 | 991 | }); |
992 | - $this->registerService(EventDispatcher::class, function () { |
|
992 | + $this->registerService(EventDispatcher::class, function() { |
|
993 | 993 | return new EventDispatcher(); |
994 | 994 | }); |
995 | 995 | $this->registerAlias('EventDispatcher', EventDispatcher::class); |
996 | 996 | $this->registerAlias(EventDispatcherInterface::class, EventDispatcher::class); |
997 | 997 | |
998 | - $this->registerService('CryptoWrapper', function (Server $c) { |
|
998 | + $this->registerService('CryptoWrapper', function(Server $c) { |
|
999 | 999 | // FIXME: Instantiiated here due to cyclic dependency |
1000 | 1000 | $request = new Request( |
1001 | 1001 | [ |
@@ -1020,7 +1020,7 @@ discard block |
||
1020 | 1020 | $request |
1021 | 1021 | ); |
1022 | 1022 | }); |
1023 | - $this->registerService('CsrfTokenManager', function (Server $c) { |
|
1023 | + $this->registerService('CsrfTokenManager', function(Server $c) { |
|
1024 | 1024 | $tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom()); |
1025 | 1025 | |
1026 | 1026 | return new CsrfTokenManager( |
@@ -1028,22 +1028,22 @@ discard block |
||
1028 | 1028 | $c->query(SessionStorage::class) |
1029 | 1029 | ); |
1030 | 1030 | }); |
1031 | - $this->registerService(SessionStorage::class, function (Server $c) { |
|
1031 | + $this->registerService(SessionStorage::class, function(Server $c) { |
|
1032 | 1032 | return new SessionStorage($c->getSession()); |
1033 | 1033 | }); |
1034 | - $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function (Server $c) { |
|
1034 | + $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function(Server $c) { |
|
1035 | 1035 | return new ContentSecurityPolicyManager(); |
1036 | 1036 | }); |
1037 | 1037 | $this->registerAlias('ContentSecurityPolicyManager', \OCP\Security\IContentSecurityPolicyManager::class); |
1038 | 1038 | |
1039 | - $this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) { |
|
1039 | + $this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) { |
|
1040 | 1040 | return new ContentSecurityPolicyNonceManager( |
1041 | 1041 | $c->getCsrfTokenManager(), |
1042 | 1042 | $c->getRequest() |
1043 | 1043 | ); |
1044 | 1044 | }); |
1045 | 1045 | |
1046 | - $this->registerService(\OCP\Share\IManager::class, function (Server $c) { |
|
1046 | + $this->registerService(\OCP\Share\IManager::class, function(Server $c) { |
|
1047 | 1047 | $config = $c->getConfig(); |
1048 | 1048 | $factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class); |
1049 | 1049 | /** @var \OCP\Share\IProviderFactory $factory */ |
@@ -1086,7 +1086,7 @@ discard block |
||
1086 | 1086 | |
1087 | 1087 | $this->registerAlias(\OCP\Collaboration\AutoComplete\IManager::class, \OC\Collaboration\AutoComplete\Manager::class); |
1088 | 1088 | |
1089 | - $this->registerService('SettingsManager', function (Server $c) { |
|
1089 | + $this->registerService('SettingsManager', function(Server $c) { |
|
1090 | 1090 | $manager = new \OC\Settings\Manager( |
1091 | 1091 | $c->getLogger(), |
1092 | 1092 | $c->getDatabaseConnection(), |
@@ -1104,36 +1104,36 @@ discard block |
||
1104 | 1104 | ); |
1105 | 1105 | return $manager; |
1106 | 1106 | }); |
1107 | - $this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) { |
|
1107 | + $this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) { |
|
1108 | 1108 | return new \OC\Files\AppData\Factory( |
1109 | 1109 | $c->getRootFolder(), |
1110 | 1110 | $c->getSystemConfig() |
1111 | 1111 | ); |
1112 | 1112 | }); |
1113 | 1113 | |
1114 | - $this->registerService('LockdownManager', function (Server $c) { |
|
1115 | - return new LockdownManager(function () use ($c) { |
|
1114 | + $this->registerService('LockdownManager', function(Server $c) { |
|
1115 | + return new LockdownManager(function() use ($c) { |
|
1116 | 1116 | return $c->getSession(); |
1117 | 1117 | }); |
1118 | 1118 | }); |
1119 | 1119 | |
1120 | - $this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) { |
|
1120 | + $this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) { |
|
1121 | 1121 | return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService()); |
1122 | 1122 | }); |
1123 | 1123 | |
1124 | - $this->registerService(ICloudIdManager::class, function (Server $c) { |
|
1124 | + $this->registerService(ICloudIdManager::class, function(Server $c) { |
|
1125 | 1125 | return new CloudIdManager(); |
1126 | 1126 | }); |
1127 | 1127 | |
1128 | - $this->registerService(IConfig::class, function (Server $c) { |
|
1128 | + $this->registerService(IConfig::class, function(Server $c) { |
|
1129 | 1129 | return new GlobalScale\Config($c->getConfig()); |
1130 | 1130 | }); |
1131 | 1131 | |
1132 | - $this->registerService(ICloudFederationProviderManager::class, function (Server $c) { |
|
1132 | + $this->registerService(ICloudFederationProviderManager::class, function(Server $c) { |
|
1133 | 1133 | return new CloudFederationProviderManager($c->getAppManager(), $c->getHTTPClientService(), $c->getCloudIdManager(), $c->getLogger()); |
1134 | 1134 | }); |
1135 | 1135 | |
1136 | - $this->registerService(ICloudFederationFactory::class, function (Server $c) { |
|
1136 | + $this->registerService(ICloudFederationFactory::class, function(Server $c) { |
|
1137 | 1137 | return new CloudFederationFactory(); |
1138 | 1138 | }); |
1139 | 1139 | |
@@ -1143,18 +1143,18 @@ discard block |
||
1143 | 1143 | $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); |
1144 | 1144 | $this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); |
1145 | 1145 | |
1146 | - $this->registerService(Defaults::class, function (Server $c) { |
|
1146 | + $this->registerService(Defaults::class, function(Server $c) { |
|
1147 | 1147 | return new Defaults( |
1148 | 1148 | $c->getThemingDefaults() |
1149 | 1149 | ); |
1150 | 1150 | }); |
1151 | 1151 | $this->registerAlias('Defaults', \OCP\Defaults::class); |
1152 | 1152 | |
1153 | - $this->registerService(\OCP\ISession::class, function (SimpleContainer $c) { |
|
1153 | + $this->registerService(\OCP\ISession::class, function(SimpleContainer $c) { |
|
1154 | 1154 | return $c->query(\OCP\IUserSession::class)->getSession(); |
1155 | 1155 | }); |
1156 | 1156 | |
1157 | - $this->registerService(IShareHelper::class, function (Server $c) { |
|
1157 | + $this->registerService(IShareHelper::class, function(Server $c) { |
|
1158 | 1158 | return new ShareHelper( |
1159 | 1159 | $c->query(\OCP\Share\IManager::class) |
1160 | 1160 | ); |
@@ -1216,11 +1216,11 @@ discard block |
||
1216 | 1216 | // no avatar to remove |
1217 | 1217 | } catch (\Exception $e) { |
1218 | 1218 | // Ignore exceptions |
1219 | - $logger->info('Could not cleanup avatar of ' . $user->getUID()); |
|
1219 | + $logger->info('Could not cleanup avatar of '.$user->getUID()); |
|
1220 | 1220 | } |
1221 | 1221 | }); |
1222 | 1222 | |
1223 | - $dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) { |
|
1223 | + $dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) { |
|
1224 | 1224 | $manager = $this->getAvatarManager(); |
1225 | 1225 | /** @var IUser $user */ |
1226 | 1226 | $user = $e->getSubject(); |
@@ -1371,7 +1371,7 @@ discard block |
||
1371 | 1371 | * @deprecated since 9.2.0 use IAppData |
1372 | 1372 | */ |
1373 | 1373 | public function getAppFolder() { |
1374 | - $dir = '/' . \OC_App::getCurrentApp(); |
|
1374 | + $dir = '/'.\OC_App::getCurrentApp(); |
|
1375 | 1375 | $root = $this->getRootFolder(); |
1376 | 1376 | if (!$root->nodeExists($dir)) { |
1377 | 1377 | $folder = $root->newFolder($dir); |
@@ -1946,7 +1946,7 @@ discard block |
||
1946 | 1946 | /** |
1947 | 1947 | * @return \OCP\Collaboration\AutoComplete\IManager |
1948 | 1948 | */ |
1949 | - public function getAutoCompleteManager(){ |
|
1949 | + public function getAutoCompleteManager() { |
|
1950 | 1950 | return $this->query(IManager::class); |
1951 | 1951 | } |
1952 | 1952 |
@@ -31,7 +31,7 @@ |
||
31 | 31 | */ |
32 | 32 | public function __construct($action) { |
33 | 33 | $l = \OC::$server->getL10N('federation'); |
34 | - $message = 'Action "' . $action . '" not supported or implemented.'; |
|
34 | + $message = 'Action "'.$action.'" not supported or implemented.'; |
|
35 | 35 | $hint = $l->t('Action "%s" not supported or implemented.', [$action]); |
36 | 36 | parent::__construct($message, $hint); |
37 | 37 | } |