@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | if ($remoteShare) { |
193 | 193 | try { |
194 | 194 | $ownerCloudId = $this->cloudIdManager->getCloudId($remoteShare['owner'], $remoteShare['remote']); |
195 | - $shareId = $this->addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $ownerCloudId->getId(), $permissions, 'tmp_token_' . time()); |
|
195 | + $shareId = $this->addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $ownerCloudId->getId(), $permissions, 'tmp_token_'.time()); |
|
196 | 196 | $share->setId($shareId); |
197 | 197 | list($token, $remoteId) = $this->askOwnerToReShare($shareWith, $share, $shareId); |
198 | 198 | // remote share was create successfully if we get a valid token as return |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | $failure = true; |
273 | 273 | } |
274 | 274 | |
275 | - if($failure) { |
|
275 | + if ($failure) { |
|
276 | 276 | $this->removeShareFromTableById($shareId); |
277 | 277 | $message_t = $this->l->t('Sharing %s failed, could not find %s, maybe the server is currently unreachable or uses a self-signed certificate.', |
278 | 278 | [$share->getNode()->getName(), $share->getSharedWith()]); |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | ->andWhere($query->expr()->eq('mountpoint', $query->createNamedParameter($share->getTarget()))); |
325 | 325 | $result = $query->execute()->fetchAll(); |
326 | 326 | |
327 | - if (isset($result[0]) && (int)$result[0]['remote_id'] > 0) { |
|
327 | + if (isset($result[0]) && (int) $result[0]['remote_id'] > 0) { |
|
328 | 328 | return $result[0]; |
329 | 329 | } |
330 | 330 | |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | $qb->execute(); |
367 | 367 | $id = $qb->getLastInsertId(); |
368 | 368 | |
369 | - return (int)$id; |
|
369 | + return (int) $id; |
|
370 | 370 | } |
371 | 371 | |
372 | 372 | /** |
@@ -456,14 +456,14 @@ discard block |
||
456 | 456 | public function getRemoteId(IShare $share) { |
457 | 457 | $query = $this->dbConnection->getQueryBuilder(); |
458 | 458 | $query->select('remote_id')->from('federated_reshares') |
459 | - ->where($query->expr()->eq('share_id', $query->createNamedParameter((int)$share->getId()))); |
|
459 | + ->where($query->expr()->eq('share_id', $query->createNamedParameter((int) $share->getId()))); |
|
460 | 460 | $data = $query->execute()->fetch(); |
461 | 461 | |
462 | 462 | if (!is_array($data) || !isset($data['remote_id'])) { |
463 | 463 | throw new ShareNotFound(); |
464 | 464 | } |
465 | 465 | |
466 | - return (int)$data['remote_id']; |
|
466 | + return (int) $data['remote_id']; |
|
467 | 467 | } |
468 | 468 | |
469 | 469 | /** |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | ->orderBy('id'); |
495 | 495 | |
496 | 496 | $cursor = $qb->execute(); |
497 | - while($data = $cursor->fetch()) { |
|
497 | + while ($data = $cursor->fetch()) { |
|
498 | 498 | $children[] = $this->createShareObject($data); |
499 | 499 | } |
500 | 500 | $cursor->closeCursor(); |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | ); |
613 | 613 | } |
614 | 614 | |
615 | - $qb->innerJoin('s', 'filecache' ,'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
615 | + $qb->innerJoin('s', 'filecache', 'f', $qb->expr()->eq('s.file_source', 'f.fileid')); |
|
616 | 616 | $qb->andWhere($qb->expr()->eq('f.parent', $qb->createNamedParameter($node->getId()))); |
617 | 617 | |
618 | 618 | $qb->orderBy('id'); |
@@ -675,7 +675,7 @@ discard block |
||
675 | 675 | |
676 | 676 | $cursor = $qb->execute(); |
677 | 677 | $shares = []; |
678 | - while($data = $cursor->fetch()) { |
|
678 | + while ($data = $cursor->fetch()) { |
|
679 | 679 | $shares[] = $this->createShareObject($data); |
680 | 680 | } |
681 | 681 | $cursor->closeCursor(); |
@@ -699,7 +699,7 @@ discard block |
||
699 | 699 | $cursor->closeCursor(); |
700 | 700 | |
701 | 701 | if ($data === false) { |
702 | - throw new ShareNotFound('Can not find share with ID: ' . $id); |
|
702 | + throw new ShareNotFound('Can not find share with ID: '.$id); |
|
703 | 703 | } |
704 | 704 | |
705 | 705 | try { |
@@ -727,7 +727,7 @@ discard block |
||
727 | 727 | ->execute(); |
728 | 728 | |
729 | 729 | $shares = []; |
730 | - while($data = $cursor->fetch()) { |
|
730 | + while ($data = $cursor->fetch()) { |
|
731 | 731 | $shares[] = $this->createShareObject($data); |
732 | 732 | } |
733 | 733 | $cursor->closeCursor(); |
@@ -766,7 +766,7 @@ discard block |
||
766 | 766 | |
767 | 767 | $cursor = $qb->execute(); |
768 | 768 | |
769 | - while($data = $cursor->fetch()) { |
|
769 | + while ($data = $cursor->fetch()) { |
|
770 | 770 | $shares[] = $this->createShareObject($data); |
771 | 771 | } |
772 | 772 | $cursor->closeCursor(); |
@@ -843,15 +843,15 @@ discard block |
||
843 | 843 | private function createShareObject($data) { |
844 | 844 | |
845 | 845 | $share = new Share($this->rootFolder, $this->userManager); |
846 | - $share->setId((int)$data['id']) |
|
847 | - ->setShareType((int)$data['share_type']) |
|
848 | - ->setPermissions((int)$data['permissions']) |
|
846 | + $share->setId((int) $data['id']) |
|
847 | + ->setShareType((int) $data['share_type']) |
|
848 | + ->setPermissions((int) $data['permissions']) |
|
849 | 849 | ->setTarget($data['file_target']) |
850 | - ->setMailSend((bool)$data['mail_send']) |
|
850 | + ->setMailSend((bool) $data['mail_send']) |
|
851 | 851 | ->setToken($data['token']); |
852 | 852 | |
853 | 853 | $shareTime = new \DateTime(); |
854 | - $shareTime->setTimestamp((int)$data['stime']); |
|
854 | + $shareTime->setTimestamp((int) $data['stime']); |
|
855 | 855 | $share->setShareTime($shareTime); |
856 | 856 | $share->setSharedWith($data['share_with']); |
857 | 857 | |
@@ -861,13 +861,13 @@ discard block |
||
861 | 861 | } else { |
862 | 862 | //OLD SHARE |
863 | 863 | $share->setSharedBy($data['uid_owner']); |
864 | - $path = $this->getNode($share->getSharedBy(), (int)$data['file_source']); |
|
864 | + $path = $this->getNode($share->getSharedBy(), (int) $data['file_source']); |
|
865 | 865 | |
866 | 866 | $owner = $path->getOwner(); |
867 | 867 | $share->setShareOwner($owner->getUID()); |
868 | 868 | } |
869 | 869 | |
870 | - $share->setNodeId((int)$data['file_source']); |
|
870 | + $share->setNodeId((int) $data['file_source']); |
|
871 | 871 | $share->setNodeType($data['item_type']); |
872 | 872 | |
873 | 873 | $share->setProviderId($this->identifier()); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | $owner = isset($_POST['owner']) ? $_POST['owner'] : null; |
146 | 146 | $sharedBy = isset($_POST['sharedBy']) ? $_POST['sharedBy'] : null; |
147 | 147 | $shareWith = isset($_POST['shareWith']) ? $_POST['shareWith'] : null; |
148 | - $remoteId = isset($_POST['remoteId']) ? (int)$_POST['remoteId'] : null; |
|
148 | + $remoteId = isset($_POST['remoteId']) ? (int) $_POST['remoteId'] : null; |
|
149 | 149 | $sharedByFederatedId = isset($_POST['sharedByFederatedId']) ? $_POST['sharedByFederatedId'] : null; |
150 | 150 | $ownerFederatedId = isset($_POST['ownerFederatedId']) ? $_POST['ownerFederatedId'] : null; |
151 | 151 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | } catch (ProviderCouldNotAddShareException $e) { |
181 | 181 | throw new OCSException($e->getMessage(), 400); |
182 | 182 | } catch (\Exception $e) { |
183 | - throw new OCSException('internal server error, was not able to add share from ' . $remote, 500); |
|
183 | + throw new OCSException('internal server error, was not able to add share from '.$remote, 500); |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | return new Http\DataResponse(); |
@@ -202,8 +202,8 @@ discard block |
||
202 | 202 | |
203 | 203 | $token = $this->request->getParam('token', null); |
204 | 204 | $shareWith = $this->request->getParam('shareWith', null); |
205 | - $permission = (int)$this->request->getParam('permission', null); |
|
206 | - $remoteId = (int)$this->request->getParam('remoteId', null); |
|
205 | + $permission = (int) $this->request->getParam('permission', null); |
|
206 | + $remoteId = (int) $this->request->getParam('remoteId', null); |
|
207 | 207 | |
208 | 208 | if ($id === null || |
209 | 209 | $token === null || |
@@ -231,9 +231,9 @@ discard block |
||
231 | 231 | } catch (ProviderDoesNotExistsException $e) { |
232 | 232 | throw new OCSException('Server does not support federated cloud sharing', 503); |
233 | 233 | } catch (ShareNotFound $e) { |
234 | - $this->logger->debug('Share not found: ' . $e->getMessage()); |
|
234 | + $this->logger->debug('Share not found: '.$e->getMessage()); |
|
235 | 235 | } catch (\Exception $e) { |
236 | - $this->logger->debug('internal server error, can not process notification: ' . $e->getMessage()); |
|
236 | + $this->logger->debug('internal server error, can not process notification: '.$e->getMessage()); |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | throw new OCSBadRequestException(); |
@@ -267,9 +267,9 @@ discard block |
||
267 | 267 | } catch (ProviderDoesNotExistsException $e) { |
268 | 268 | throw new OCSException('Server does not support federated cloud sharing', 503); |
269 | 269 | } catch (ShareNotFound $e) { |
270 | - $this->logger->debug('Share not found: ' . $e->getMessage()); |
|
270 | + $this->logger->debug('Share not found: '.$e->getMessage()); |
|
271 | 271 | } catch (\Exception $e) { |
272 | - $this->logger->debug('internal server error, can not process notification: ' . $e->getMessage()); |
|
272 | + $this->logger->debug('internal server error, can not process notification: '.$e->getMessage()); |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | return new Http\DataResponse(); |
@@ -300,9 +300,9 @@ discard block |
||
300 | 300 | } catch (ProviderDoesNotExistsException $e) { |
301 | 301 | throw new OCSException('Server does not support federated cloud sharing', 503); |
302 | 302 | } catch (ShareNotFound $e) { |
303 | - $this->logger->debug('Share not found: ' . $e->getMessage()); |
|
303 | + $this->logger->debug('Share not found: '.$e->getMessage()); |
|
304 | 304 | } catch (\Exception $e) { |
305 | - $this->logger->debug('internal server error, can not process notification: ' . $e->getMessage()); |
|
305 | + $this->logger->debug('internal server error, can not process notification: '.$e->getMessage()); |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | return new Http\DataResponse(); |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | $notification = ['sharedSecret' => $token]; |
332 | 332 | $provider->notificationReceived('SHARE_UNSHARED', $id, $notification); |
333 | 333 | } catch (\Exception $e) { |
334 | - $this->logger->debug('processing unshare notification failed: ' . $e->getMessage()); |
|
334 | + $this->logger->debug('processing unshare notification failed: '.$e->getMessage()); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | return new Http\DataResponse(); |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | |
405 | 405 | try { |
406 | 406 | $provider = $this->cloudFederationProviderManager->getCloudFederationProvider('file'); |
407 | - $ocmPermissions = $this->ncPermissions2ocmPermissions((int)$ncPermissions); |
|
407 | + $ocmPermissions = $this->ncPermissions2ocmPermissions((int) $ncPermissions); |
|
408 | 408 | $notification = ['sharedSecret' => $token, 'permission' => $ocmPermissions]; |
409 | 409 | $provider->notificationReceived('RESHARE_CHANGE_PERMISSION', $id, $notification); |
410 | 410 | } catch (\Exception $e) { |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | |
150 | 150 | if (!$this->userManager->userExists($shareWith)) { |
151 | 151 | return new JSONResponse( |
152 | - ['message' => 'User "' . $shareWith . '" does not exists at ' . $this->urlGenerator->getBaseUrl()], |
|
152 | + ['message' => 'User "'.$shareWith.'" does not exists at '.$this->urlGenerator->getBaseUrl()], |
|
153 | 153 | Http::STATUS_BAD_REQUEST |
154 | 154 | ); |
155 | 155 | } |
@@ -181,14 +181,14 @@ discard block |
||
181 | 181 | ); |
182 | 182 | } catch (\Exception $e) { |
183 | 183 | return new JSONResponse( |
184 | - ['message' => 'Internal error at ' . $this->urlGenerator->getBaseUrl()], |
|
184 | + ['message' => 'Internal error at '.$this->urlGenerator->getBaseUrl()], |
|
185 | 185 | Http::STATUS_BAD_REQUEST |
186 | 186 | ); |
187 | 187 | } |
188 | 188 | |
189 | 189 | $user = $this->userManager->get($shareWithLocalId); |
190 | 190 | $recipientDisplayName = ''; |
191 | - if($user) { |
|
191 | + if ($user) { |
|
192 | 192 | $recipientDisplayName = $user->getDisplayName(); |
193 | 193 | } |
194 | 194 | |
@@ -256,12 +256,12 @@ discard block |
||
256 | 256 | } |
257 | 257 | catch (\Exception $e) { |
258 | 258 | return new JSONResponse( |
259 | - ['message' => 'Internal error at ' . $this->urlGenerator->getBaseUrl()], |
|
259 | + ['message' => 'Internal error at '.$this->urlGenerator->getBaseUrl()], |
|
260 | 260 | Http::STATUS_BAD_REQUEST |
261 | 261 | ); |
262 | 262 | } |
263 | 263 | |
264 | - return new JSONResponse($result,Http::STATUS_CREATED); |
|
264 | + return new JSONResponse($result, Http::STATUS_CREATED); |
|
265 | 265 | |
266 | 266 | } |
267 | 267 | |
@@ -274,13 +274,13 @@ discard block |
||
274 | 274 | private function mapUid($uid) { |
275 | 275 | \OC::$server->getURLGenerator()->linkToDocs('key'); |
276 | 276 | // FIXME this should be a method in the user management instead |
277 | - $this->logger->debug('shareWith before, ' . $uid, ['app' => $this->appName]); |
|
277 | + $this->logger->debug('shareWith before, '.$uid, ['app' => $this->appName]); |
|
278 | 278 | \OCP\Util::emitHook( |
279 | 279 | '\OCA\Files_Sharing\API\Server2Server', |
280 | 280 | 'preLoginNameUsedAsUserName', |
281 | 281 | array('uid' => &$uid) |
282 | 282 | ); |
283 | - $this->logger->debug('shareWith after, ' . $uid, ['app' => $this->appName]); |
|
283 | + $this->logger->debug('shareWith after, '.$uid, ['app' => $this->appName]); |
|
284 | 284 | |
285 | 285 | return $uid; |
286 | 286 | } |
@@ -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,13 +340,13 @@ 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 | 347 | $this->registerAlias(IProvider::class, Authentication\Token\Manager::class); |
348 | 348 | |
349 | - $this->registerService(\OCP\IUserSession::class, function (Server $c) { |
|
349 | + $this->registerService(\OCP\IUserSession::class, function(Server $c) { |
|
350 | 350 | $manager = $c->getUserManager(); |
351 | 351 | $session = new \OC\Session\Memory(''); |
352 | 352 | $timeFactory = new TimeFactory(); |
@@ -370,45 +370,45 @@ discard block |
||
370 | 370 | $c->getLockdownManager(), |
371 | 371 | $c->getLogger() |
372 | 372 | ); |
373 | - $userSession->listen('\OC\User', 'preCreateUser', function ($uid, $password) { |
|
373 | + $userSession->listen('\OC\User', 'preCreateUser', function($uid, $password) { |
|
374 | 374 | \OC_Hook::emit('OC_User', 'pre_createUser', array('run' => true, 'uid' => $uid, 'password' => $password)); |
375 | 375 | }); |
376 | - $userSession->listen('\OC\User', 'postCreateUser', function ($user, $password) { |
|
376 | + $userSession->listen('\OC\User', 'postCreateUser', function($user, $password) { |
|
377 | 377 | /** @var $user \OC\User\User */ |
378 | 378 | \OC_Hook::emit('OC_User', 'post_createUser', array('uid' => $user->getUID(), 'password' => $password)); |
379 | 379 | }); |
380 | - $userSession->listen('\OC\User', 'preDelete', function ($user) use ($dispatcher) { |
|
380 | + $userSession->listen('\OC\User', 'preDelete', function($user) use ($dispatcher) { |
|
381 | 381 | /** @var $user \OC\User\User */ |
382 | 382 | \OC_Hook::emit('OC_User', 'pre_deleteUser', array('run' => true, 'uid' => $user->getUID())); |
383 | 383 | $dispatcher->dispatch('OCP\IUser::preDelete', new GenericEvent($user)); |
384 | 384 | }); |
385 | - $userSession->listen('\OC\User', 'postDelete', function ($user) { |
|
385 | + $userSession->listen('\OC\User', 'postDelete', function($user) { |
|
386 | 386 | /** @var $user \OC\User\User */ |
387 | 387 | \OC_Hook::emit('OC_User', 'post_deleteUser', array('uid' => $user->getUID())); |
388 | 388 | }); |
389 | - $userSession->listen('\OC\User', 'preSetPassword', function ($user, $password, $recoveryPassword) { |
|
389 | + $userSession->listen('\OC\User', 'preSetPassword', function($user, $password, $recoveryPassword) { |
|
390 | 390 | /** @var $user \OC\User\User */ |
391 | 391 | \OC_Hook::emit('OC_User', 'pre_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
392 | 392 | }); |
393 | - $userSession->listen('\OC\User', 'postSetPassword', function ($user, $password, $recoveryPassword) { |
|
393 | + $userSession->listen('\OC\User', 'postSetPassword', function($user, $password, $recoveryPassword) { |
|
394 | 394 | /** @var $user \OC\User\User */ |
395 | 395 | \OC_Hook::emit('OC_User', 'post_setPassword', array('run' => true, 'uid' => $user->getUID(), 'password' => $password, 'recoveryPassword' => $recoveryPassword)); |
396 | 396 | }); |
397 | - $userSession->listen('\OC\User', 'preLogin', function ($uid, $password) { |
|
397 | + $userSession->listen('\OC\User', 'preLogin', function($uid, $password) { |
|
398 | 398 | \OC_Hook::emit('OC_User', 'pre_login', array('run' => true, 'uid' => $uid, 'password' => $password)); |
399 | 399 | }); |
400 | - $userSession->listen('\OC\User', 'postLogin', function ($user, $password) { |
|
400 | + $userSession->listen('\OC\User', 'postLogin', function($user, $password) { |
|
401 | 401 | /** @var $user \OC\User\User */ |
402 | 402 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
403 | 403 | }); |
404 | - $userSession->listen('\OC\User', 'postRememberedLogin', function ($user, $password) { |
|
404 | + $userSession->listen('\OC\User', 'postRememberedLogin', function($user, $password) { |
|
405 | 405 | /** @var $user \OC\User\User */ |
406 | 406 | \OC_Hook::emit('OC_User', 'post_login', array('run' => true, 'uid' => $user->getUID(), 'password' => $password)); |
407 | 407 | }); |
408 | - $userSession->listen('\OC\User', 'logout', function () { |
|
408 | + $userSession->listen('\OC\User', 'logout', function() { |
|
409 | 409 | \OC_Hook::emit('OC_User', 'logout', array()); |
410 | 410 | }); |
411 | - $userSession->listen('\OC\User', 'changeUser', function ($user, $feature, $value, $oldValue) use ($dispatcher) { |
|
411 | + $userSession->listen('\OC\User', 'changeUser', function($user, $feature, $value, $oldValue) use ($dispatcher) { |
|
412 | 412 | /** @var $user \OC\User\User */ |
413 | 413 | \OC_Hook::emit('OC_User', 'changeUser', array('run' => true, 'user' => $user, 'feature' => $feature, 'value' => $value, 'old_value' => $oldValue)); |
414 | 414 | $dispatcher->dispatch('OCP\IUser::changeUser', new GenericEvent($user, ['feature' => $feature, 'oldValue' => $oldValue, 'value' => $value])); |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | }); |
418 | 418 | $this->registerAlias('UserSession', \OCP\IUserSession::class); |
419 | 419 | |
420 | - $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function (Server $c) { |
|
420 | + $this->registerService(\OC\Authentication\TwoFactorAuth\Manager::class, function(Server $c) { |
|
421 | 421 | return new \OC\Authentication\TwoFactorAuth\Manager( |
422 | 422 | $c->getAppManager(), |
423 | 423 | $c->getSession(), |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | $this->registerAlias(\OCP\INavigationManager::class, \OC\NavigationManager::class); |
434 | 434 | $this->registerAlias('NavigationManager', \OCP\INavigationManager::class); |
435 | 435 | |
436 | - $this->registerService(\OC\AllConfig::class, function (Server $c) { |
|
436 | + $this->registerService(\OC\AllConfig::class, function(Server $c) { |
|
437 | 437 | return new \OC\AllConfig( |
438 | 438 | $c->getSystemConfig() |
439 | 439 | ); |
@@ -441,17 +441,17 @@ discard block |
||
441 | 441 | $this->registerAlias('AllConfig', \OC\AllConfig::class); |
442 | 442 | $this->registerAlias(\OCP\IConfig::class, \OC\AllConfig::class); |
443 | 443 | |
444 | - $this->registerService('SystemConfig', function ($c) use ($config) { |
|
444 | + $this->registerService('SystemConfig', function($c) use ($config) { |
|
445 | 445 | return new \OC\SystemConfig($config); |
446 | 446 | }); |
447 | 447 | |
448 | - $this->registerService(\OC\AppConfig::class, function (Server $c) { |
|
448 | + $this->registerService(\OC\AppConfig::class, function(Server $c) { |
|
449 | 449 | return new \OC\AppConfig($c->getDatabaseConnection()); |
450 | 450 | }); |
451 | 451 | $this->registerAlias('AppConfig', \OC\AppConfig::class); |
452 | 452 | $this->registerAlias(\OCP\IAppConfig::class, \OC\AppConfig::class); |
453 | 453 | |
454 | - $this->registerService(\OCP\L10N\IFactory::class, function (Server $c) { |
|
454 | + $this->registerService(\OCP\L10N\IFactory::class, function(Server $c) { |
|
455 | 455 | return new \OC\L10N\Factory( |
456 | 456 | $c->getConfig(), |
457 | 457 | $c->getRequest(), |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | }); |
462 | 462 | $this->registerAlias('L10NFactory', \OCP\L10N\IFactory::class); |
463 | 463 | |
464 | - $this->registerService(\OCP\IURLGenerator::class, function (Server $c) { |
|
464 | + $this->registerService(\OCP\IURLGenerator::class, function(Server $c) { |
|
465 | 465 | $config = $c->getConfig(); |
466 | 466 | $cacheFactory = $c->getMemCacheFactory(); |
467 | 467 | $request = $c->getRequest(); |
@@ -476,12 +476,12 @@ discard block |
||
476 | 476 | $this->registerAlias('AppFetcher', AppFetcher::class); |
477 | 477 | $this->registerAlias('CategoryFetcher', CategoryFetcher::class); |
478 | 478 | |
479 | - $this->registerService(\OCP\ICache::class, function ($c) { |
|
479 | + $this->registerService(\OCP\ICache::class, function($c) { |
|
480 | 480 | return new Cache\File(); |
481 | 481 | }); |
482 | 482 | $this->registerAlias('UserCache', \OCP\ICache::class); |
483 | 483 | |
484 | - $this->registerService(Factory::class, function (Server $c) { |
|
484 | + $this->registerService(Factory::class, function(Server $c) { |
|
485 | 485 | |
486 | 486 | $arrayCacheFactory = new \OC\Memcache\Factory('', $c->getLogger(), |
487 | 487 | ArrayCache::class, |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | $version = implode(',', $v); |
499 | 499 | $instanceId = \OC_Util::getInstanceId(); |
500 | 500 | $path = \OC::$SERVERROOT; |
501 | - $prefix = md5($instanceId . '-' . $version . '-' . $path); |
|
501 | + $prefix = md5($instanceId.'-'.$version.'-'.$path); |
|
502 | 502 | return new \OC\Memcache\Factory($prefix, $c->getLogger(), |
503 | 503 | $config->getSystemValue('memcache.local', null), |
504 | 504 | $config->getSystemValue('memcache.distributed', null), |
@@ -511,12 +511,12 @@ discard block |
||
511 | 511 | $this->registerAlias('MemCacheFactory', Factory::class); |
512 | 512 | $this->registerAlias(ICacheFactory::class, Factory::class); |
513 | 513 | |
514 | - $this->registerService('RedisFactory', function (Server $c) { |
|
514 | + $this->registerService('RedisFactory', function(Server $c) { |
|
515 | 515 | $systemConfig = $c->getSystemConfig(); |
516 | 516 | return new RedisFactory($systemConfig); |
517 | 517 | }); |
518 | 518 | |
519 | - $this->registerService(\OCP\Activity\IManager::class, function (Server $c) { |
|
519 | + $this->registerService(\OCP\Activity\IManager::class, function(Server $c) { |
|
520 | 520 | return new \OC\Activity\Manager( |
521 | 521 | $c->getRequest(), |
522 | 522 | $c->getUserSession(), |
@@ -526,14 +526,14 @@ discard block |
||
526 | 526 | }); |
527 | 527 | $this->registerAlias('ActivityManager', \OCP\Activity\IManager::class); |
528 | 528 | |
529 | - $this->registerService(\OCP\Activity\IEventMerger::class, function (Server $c) { |
|
529 | + $this->registerService(\OCP\Activity\IEventMerger::class, function(Server $c) { |
|
530 | 530 | return new \OC\Activity\EventMerger( |
531 | 531 | $c->getL10N('lib') |
532 | 532 | ); |
533 | 533 | }); |
534 | 534 | $this->registerAlias(IValidator::class, Validator::class); |
535 | 535 | |
536 | - $this->registerService(\OCP\IAvatarManager::class, function (Server $c) { |
|
536 | + $this->registerService(\OCP\IAvatarManager::class, function(Server $c) { |
|
537 | 537 | return new AvatarManager( |
538 | 538 | $c->query(\OC\User\Manager::class), |
539 | 539 | $c->getAppDataDir('avatar'), |
@@ -546,7 +546,7 @@ discard block |
||
546 | 546 | |
547 | 547 | $this->registerAlias(\OCP\Support\CrashReport\IRegistry::class, \OC\Support\CrashReport\Registry::class); |
548 | 548 | |
549 | - $this->registerService(\OCP\ILogger::class, function (Server $c) { |
|
549 | + $this->registerService(\OCP\ILogger::class, function(Server $c) { |
|
550 | 550 | $logType = $c->query('AllConfig')->getSystemValue('log_type', 'file'); |
551 | 551 | $factory = new LogFactory($c, $this->getSystemConfig()); |
552 | 552 | $logger = $factory->get($logType); |
@@ -556,11 +556,11 @@ discard block |
||
556 | 556 | }); |
557 | 557 | $this->registerAlias('Logger', \OCP\ILogger::class); |
558 | 558 | |
559 | - $this->registerService(ILogFactory::class, function (Server $c) { |
|
559 | + $this->registerService(ILogFactory::class, function(Server $c) { |
|
560 | 560 | return new LogFactory($c, $this->getSystemConfig()); |
561 | 561 | }); |
562 | 562 | |
563 | - $this->registerService(\OCP\BackgroundJob\IJobList::class, function (Server $c) { |
|
563 | + $this->registerService(\OCP\BackgroundJob\IJobList::class, function(Server $c) { |
|
564 | 564 | $config = $c->getConfig(); |
565 | 565 | return new \OC\BackgroundJob\JobList( |
566 | 566 | $c->getDatabaseConnection(), |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | }); |
571 | 571 | $this->registerAlias('JobList', \OCP\BackgroundJob\IJobList::class); |
572 | 572 | |
573 | - $this->registerService(\OCP\Route\IRouter::class, function (Server $c) { |
|
573 | + $this->registerService(\OCP\Route\IRouter::class, function(Server $c) { |
|
574 | 574 | $cacheFactory = $c->getMemCacheFactory(); |
575 | 575 | $logger = $c->getLogger(); |
576 | 576 | if ($cacheFactory->isLocalCacheAvailable()) { |
@@ -582,12 +582,12 @@ discard block |
||
582 | 582 | }); |
583 | 583 | $this->registerAlias('Router', \OCP\Route\IRouter::class); |
584 | 584 | |
585 | - $this->registerService(\OCP\ISearch::class, function ($c) { |
|
585 | + $this->registerService(\OCP\ISearch::class, function($c) { |
|
586 | 586 | return new Search(); |
587 | 587 | }); |
588 | 588 | $this->registerAlias('Search', \OCP\ISearch::class); |
589 | 589 | |
590 | - $this->registerService(\OC\Security\RateLimiting\Limiter::class, function (Server $c) { |
|
590 | + $this->registerService(\OC\Security\RateLimiting\Limiter::class, function(Server $c) { |
|
591 | 591 | return new \OC\Security\RateLimiting\Limiter( |
592 | 592 | $this->getUserSession(), |
593 | 593 | $this->getRequest(), |
@@ -595,34 +595,34 @@ discard block |
||
595 | 595 | $c->query(\OC\Security\RateLimiting\Backend\IBackend::class) |
596 | 596 | ); |
597 | 597 | }); |
598 | - $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { |
|
598 | + $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function($c) { |
|
599 | 599 | return new \OC\Security\RateLimiting\Backend\MemoryCache( |
600 | 600 | $this->getMemCacheFactory(), |
601 | 601 | new \OC\AppFramework\Utility\TimeFactory() |
602 | 602 | ); |
603 | 603 | }); |
604 | 604 | |
605 | - $this->registerService(\OCP\Security\ISecureRandom::class, function ($c) { |
|
605 | + $this->registerService(\OCP\Security\ISecureRandom::class, function($c) { |
|
606 | 606 | return new SecureRandom(); |
607 | 607 | }); |
608 | 608 | $this->registerAlias('SecureRandom', \OCP\Security\ISecureRandom::class); |
609 | 609 | |
610 | - $this->registerService(\OCP\Security\ICrypto::class, function (Server $c) { |
|
610 | + $this->registerService(\OCP\Security\ICrypto::class, function(Server $c) { |
|
611 | 611 | return new Crypto($c->getConfig(), $c->getSecureRandom()); |
612 | 612 | }); |
613 | 613 | $this->registerAlias('Crypto', \OCP\Security\ICrypto::class); |
614 | 614 | |
615 | - $this->registerService(\OCP\Security\IHasher::class, function (Server $c) { |
|
615 | + $this->registerService(\OCP\Security\IHasher::class, function(Server $c) { |
|
616 | 616 | return new Hasher($c->getConfig()); |
617 | 617 | }); |
618 | 618 | $this->registerAlias('Hasher', \OCP\Security\IHasher::class); |
619 | 619 | |
620 | - $this->registerService(\OCP\Security\ICredentialsManager::class, function (Server $c) { |
|
620 | + $this->registerService(\OCP\Security\ICredentialsManager::class, function(Server $c) { |
|
621 | 621 | return new CredentialsManager($c->getCrypto(), $c->getDatabaseConnection()); |
622 | 622 | }); |
623 | 623 | $this->registerAlias('CredentialsManager', \OCP\Security\ICredentialsManager::class); |
624 | 624 | |
625 | - $this->registerService(IDBConnection::class, function (Server $c) { |
|
625 | + $this->registerService(IDBConnection::class, function(Server $c) { |
|
626 | 626 | $systemConfig = $c->getSystemConfig(); |
627 | 627 | $factory = new \OC\DB\ConnectionFactory($systemConfig); |
628 | 628 | $type = $systemConfig->getValue('dbtype', 'sqlite'); |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | $this->registerAlias('DatabaseConnection', IDBConnection::class); |
638 | 638 | |
639 | 639 | |
640 | - $this->registerService(\OCP\Http\Client\IClientService::class, function (Server $c) { |
|
640 | + $this->registerService(\OCP\Http\Client\IClientService::class, function(Server $c) { |
|
641 | 641 | $user = \OC_User::getUser(); |
642 | 642 | $uid = $user ? $user : null; |
643 | 643 | return new ClientService( |
@@ -652,7 +652,7 @@ discard block |
||
652 | 652 | ); |
653 | 653 | }); |
654 | 654 | $this->registerAlias('HttpClientService', \OCP\Http\Client\IClientService::class); |
655 | - $this->registerService(\OCP\Diagnostics\IEventLogger::class, function (Server $c) { |
|
655 | + $this->registerService(\OCP\Diagnostics\IEventLogger::class, function(Server $c) { |
|
656 | 656 | $eventLogger = new EventLogger(); |
657 | 657 | if ($c->getSystemConfig()->getValue('debug', false)) { |
658 | 658 | // In debug mode, module is being activated by default |
@@ -662,7 +662,7 @@ discard block |
||
662 | 662 | }); |
663 | 663 | $this->registerAlias('EventLogger', \OCP\Diagnostics\IEventLogger::class); |
664 | 664 | |
665 | - $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function (Server $c) { |
|
665 | + $this->registerService(\OCP\Diagnostics\IQueryLogger::class, function(Server $c) { |
|
666 | 666 | $queryLogger = new QueryLogger(); |
667 | 667 | if ($c->getSystemConfig()->getValue('debug', false)) { |
668 | 668 | // In debug mode, module is being activated by default |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | }); |
673 | 673 | $this->registerAlias('QueryLogger', \OCP\Diagnostics\IQueryLogger::class); |
674 | 674 | |
675 | - $this->registerService(TempManager::class, function (Server $c) { |
|
675 | + $this->registerService(TempManager::class, function(Server $c) { |
|
676 | 676 | return new TempManager( |
677 | 677 | $c->getLogger(), |
678 | 678 | $c->getConfig() |
@@ -681,7 +681,7 @@ discard block |
||
681 | 681 | $this->registerAlias('TempManager', TempManager::class); |
682 | 682 | $this->registerAlias(ITempManager::class, TempManager::class); |
683 | 683 | |
684 | - $this->registerService(AppManager::class, function (Server $c) { |
|
684 | + $this->registerService(AppManager::class, function(Server $c) { |
|
685 | 685 | return new \OC\App\AppManager( |
686 | 686 | $c->getUserSession(), |
687 | 687 | $c->query(\OC\AppConfig::class), |
@@ -693,7 +693,7 @@ discard block |
||
693 | 693 | $this->registerAlias('AppManager', AppManager::class); |
694 | 694 | $this->registerAlias(IAppManager::class, AppManager::class); |
695 | 695 | |
696 | - $this->registerService(\OCP\IDateTimeZone::class, function (Server $c) { |
|
696 | + $this->registerService(\OCP\IDateTimeZone::class, function(Server $c) { |
|
697 | 697 | return new DateTimeZone( |
698 | 698 | $c->getConfig(), |
699 | 699 | $c->getSession() |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | }); |
702 | 702 | $this->registerAlias('DateTimeZone', \OCP\IDateTimeZone::class); |
703 | 703 | |
704 | - $this->registerService(\OCP\IDateTimeFormatter::class, function (Server $c) { |
|
704 | + $this->registerService(\OCP\IDateTimeFormatter::class, function(Server $c) { |
|
705 | 705 | $language = $c->getConfig()->getUserValue($c->getSession()->get('user_id'), 'core', 'lang', null); |
706 | 706 | |
707 | 707 | return new DateTimeFormatter( |
@@ -711,7 +711,7 @@ discard block |
||
711 | 711 | }); |
712 | 712 | $this->registerAlias('DateTimeFormatter', \OCP\IDateTimeFormatter::class); |
713 | 713 | |
714 | - $this->registerService(\OCP\Files\Config\IUserMountCache::class, function (Server $c) { |
|
714 | + $this->registerService(\OCP\Files\Config\IUserMountCache::class, function(Server $c) { |
|
715 | 715 | $mountCache = new UserMountCache($c->getDatabaseConnection(), $c->getUserManager(), $c->getLogger()); |
716 | 716 | $listener = new UserMountCacheListener($mountCache); |
717 | 717 | $listener->listen($c->getUserManager()); |
@@ -719,7 +719,7 @@ discard block |
||
719 | 719 | }); |
720 | 720 | $this->registerAlias('UserMountCache', \OCP\Files\Config\IUserMountCache::class); |
721 | 721 | |
722 | - $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function (Server $c) { |
|
722 | + $this->registerService(\OCP\Files\Config\IMountProviderCollection::class, function(Server $c) { |
|
723 | 723 | $loader = \OC\Files\Filesystem::getLoader(); |
724 | 724 | $mountCache = $c->query('UserMountCache'); |
725 | 725 | $manager = new \OC\Files\Config\MountProviderCollection($loader, $mountCache); |
@@ -735,10 +735,10 @@ discard block |
||
735 | 735 | }); |
736 | 736 | $this->registerAlias('MountConfigManager', \OCP\Files\Config\IMountProviderCollection::class); |
737 | 737 | |
738 | - $this->registerService('IniWrapper', function ($c) { |
|
738 | + $this->registerService('IniWrapper', function($c) { |
|
739 | 739 | return new IniGetWrapper(); |
740 | 740 | }); |
741 | - $this->registerService('AsyncCommandBus', function (Server $c) { |
|
741 | + $this->registerService('AsyncCommandBus', function(Server $c) { |
|
742 | 742 | $busClass = $c->getConfig()->getSystemValue('commandbus'); |
743 | 743 | if ($busClass) { |
744 | 744 | list($app, $class) = explode('::', $busClass, 2); |
@@ -753,10 +753,10 @@ discard block |
||
753 | 753 | return new CronBus($jobList); |
754 | 754 | } |
755 | 755 | }); |
756 | - $this->registerService('TrustedDomainHelper', function ($c) { |
|
756 | + $this->registerService('TrustedDomainHelper', function($c) { |
|
757 | 757 | return new TrustedDomainHelper($this->getConfig()); |
758 | 758 | }); |
759 | - $this->registerService('Throttler', function (Server $c) { |
|
759 | + $this->registerService('Throttler', function(Server $c) { |
|
760 | 760 | return new Throttler( |
761 | 761 | $c->getDatabaseConnection(), |
762 | 762 | new TimeFactory(), |
@@ -764,7 +764,7 @@ discard block |
||
764 | 764 | $c->getConfig() |
765 | 765 | ); |
766 | 766 | }); |
767 | - $this->registerService('IntegrityCodeChecker', function (Server $c) { |
|
767 | + $this->registerService('IntegrityCodeChecker', function(Server $c) { |
|
768 | 768 | // IConfig and IAppManager requires a working database. This code |
769 | 769 | // might however be called when ownCloud is not yet setup. |
770 | 770 | if (\OC::$server->getSystemConfig()->getValue('installed', false)) { |
@@ -785,7 +785,7 @@ discard block |
||
785 | 785 | $c->getTempManager() |
786 | 786 | ); |
787 | 787 | }); |
788 | - $this->registerService(\OCP\IRequest::class, function ($c) { |
|
788 | + $this->registerService(\OCP\IRequest::class, function($c) { |
|
789 | 789 | if (isset($this['urlParams'])) { |
790 | 790 | $urlParams = $this['urlParams']; |
791 | 791 | } else { |
@@ -821,7 +821,7 @@ discard block |
||
821 | 821 | }); |
822 | 822 | $this->registerAlias('Request', \OCP\IRequest::class); |
823 | 823 | |
824 | - $this->registerService(\OCP\Mail\IMailer::class, function (Server $c) { |
|
824 | + $this->registerService(\OCP\Mail\IMailer::class, function(Server $c) { |
|
825 | 825 | return new Mailer( |
826 | 826 | $c->getConfig(), |
827 | 827 | $c->getLogger(), |
@@ -832,7 +832,7 @@ discard block |
||
832 | 832 | }); |
833 | 833 | $this->registerAlias('Mailer', \OCP\Mail\IMailer::class); |
834 | 834 | |
835 | - $this->registerService('LDAPProvider', function (Server $c) { |
|
835 | + $this->registerService('LDAPProvider', function(Server $c) { |
|
836 | 836 | $config = $c->getConfig(); |
837 | 837 | $factoryClass = $config->getSystemValue('ldapProviderFactory', null); |
838 | 838 | if (is_null($factoryClass)) { |
@@ -842,7 +842,7 @@ discard block |
||
842 | 842 | $factory = new $factoryClass($this); |
843 | 843 | return $factory->getLDAPProvider(); |
844 | 844 | }); |
845 | - $this->registerService(ILockingProvider::class, function (Server $c) { |
|
845 | + $this->registerService(ILockingProvider::class, function(Server $c) { |
|
846 | 846 | $ini = $c->getIniWrapper(); |
847 | 847 | $config = $c->getConfig(); |
848 | 848 | $ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time'))); |
@@ -865,49 +865,49 @@ discard block |
||
865 | 865 | }); |
866 | 866 | $this->registerAlias('LockingProvider', ILockingProvider::class); |
867 | 867 | |
868 | - $this->registerService(\OCP\Files\Mount\IMountManager::class, function () { |
|
868 | + $this->registerService(\OCP\Files\Mount\IMountManager::class, function() { |
|
869 | 869 | return new \OC\Files\Mount\Manager(); |
870 | 870 | }); |
871 | 871 | $this->registerAlias('MountManager', \OCP\Files\Mount\IMountManager::class); |
872 | 872 | |
873 | - $this->registerService(\OCP\Files\IMimeTypeDetector::class, function (Server $c) { |
|
873 | + $this->registerService(\OCP\Files\IMimeTypeDetector::class, function(Server $c) { |
|
874 | 874 | return new \OC\Files\Type\Detection( |
875 | 875 | $c->getURLGenerator(), |
876 | 876 | \OC::$configDir, |
877 | - \OC::$SERVERROOT . '/resources/config/' |
|
877 | + \OC::$SERVERROOT.'/resources/config/' |
|
878 | 878 | ); |
879 | 879 | }); |
880 | 880 | $this->registerAlias('MimeTypeDetector', \OCP\Files\IMimeTypeDetector::class); |
881 | 881 | |
882 | - $this->registerService(\OCP\Files\IMimeTypeLoader::class, function (Server $c) { |
|
882 | + $this->registerService(\OCP\Files\IMimeTypeLoader::class, function(Server $c) { |
|
883 | 883 | return new \OC\Files\Type\Loader( |
884 | 884 | $c->getDatabaseConnection() |
885 | 885 | ); |
886 | 886 | }); |
887 | 887 | $this->registerAlias('MimeTypeLoader', \OCP\Files\IMimeTypeLoader::class); |
888 | - $this->registerService(BundleFetcher::class, function () { |
|
888 | + $this->registerService(BundleFetcher::class, function() { |
|
889 | 889 | return new BundleFetcher($this->getL10N('lib')); |
890 | 890 | }); |
891 | - $this->registerService(\OCP\Notification\IManager::class, function (Server $c) { |
|
891 | + $this->registerService(\OCP\Notification\IManager::class, function(Server $c) { |
|
892 | 892 | return new Manager( |
893 | 893 | $c->query(IValidator::class) |
894 | 894 | ); |
895 | 895 | }); |
896 | 896 | $this->registerAlias('NotificationManager', \OCP\Notification\IManager::class); |
897 | 897 | |
898 | - $this->registerService(\OC\CapabilitiesManager::class, function (Server $c) { |
|
898 | + $this->registerService(\OC\CapabilitiesManager::class, function(Server $c) { |
|
899 | 899 | $manager = new \OC\CapabilitiesManager($c->getLogger()); |
900 | - $manager->registerCapability(function () use ($c) { |
|
900 | + $manager->registerCapability(function() use ($c) { |
|
901 | 901 | return new \OC\OCS\CoreCapabilities($c->getConfig()); |
902 | 902 | }); |
903 | - $manager->registerCapability(function () use ($c) { |
|
903 | + $manager->registerCapability(function() use ($c) { |
|
904 | 904 | return $c->query(\OC\Security\Bruteforce\Capabilities::class); |
905 | 905 | }); |
906 | 906 | return $manager; |
907 | 907 | }); |
908 | 908 | $this->registerAlias('CapabilitiesManager', \OC\CapabilitiesManager::class); |
909 | 909 | |
910 | - $this->registerService(\OCP\Comments\ICommentsManager::class, function (Server $c) { |
|
910 | + $this->registerService(\OCP\Comments\ICommentsManager::class, function(Server $c) { |
|
911 | 911 | $config = $c->getConfig(); |
912 | 912 | $factoryClass = $config->getSystemValue('comments.managerFactory', CommentsManagerFactory::class); |
913 | 913 | /** @var \OCP\Comments\ICommentsManagerFactory $factory */ |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | $manager->registerDisplayNameResolver('user', function($id) use ($c) { |
918 | 918 | $manager = $c->getUserManager(); |
919 | 919 | $user = $manager->get($id); |
920 | - if(is_null($user)) { |
|
920 | + if (is_null($user)) { |
|
921 | 921 | $l = $c->getL10N('core'); |
922 | 922 | $displayName = $l->t('Unknown user'); |
923 | 923 | } else { |
@@ -930,7 +930,7 @@ discard block |
||
930 | 930 | }); |
931 | 931 | $this->registerAlias('CommentsManager', \OCP\Comments\ICommentsManager::class); |
932 | 932 | |
933 | - $this->registerService('ThemingDefaults', function (Server $c) { |
|
933 | + $this->registerService('ThemingDefaults', function(Server $c) { |
|
934 | 934 | /* |
935 | 935 | * Dark magic for autoloader. |
936 | 936 | * If we do a class_exists it will try to load the class which will |
@@ -957,7 +957,7 @@ discard block |
||
957 | 957 | } |
958 | 958 | return new \OC_Defaults(); |
959 | 959 | }); |
960 | - $this->registerService(SCSSCacher::class, function (Server $c) { |
|
960 | + $this->registerService(SCSSCacher::class, function(Server $c) { |
|
961 | 961 | /** @var Factory $cacheFactory */ |
962 | 962 | $cacheFactory = $c->query(Factory::class); |
963 | 963 | return new SCSSCacher( |
@@ -970,7 +970,7 @@ discard block |
||
970 | 970 | $this->getMemCacheFactory() |
971 | 971 | ); |
972 | 972 | }); |
973 | - $this->registerService(JSCombiner::class, function (Server $c) { |
|
973 | + $this->registerService(JSCombiner::class, function(Server $c) { |
|
974 | 974 | /** @var Factory $cacheFactory */ |
975 | 975 | $cacheFactory = $c->query(Factory::class); |
976 | 976 | return new JSCombiner( |
@@ -981,13 +981,13 @@ discard block |
||
981 | 981 | $c->getLogger() |
982 | 982 | ); |
983 | 983 | }); |
984 | - $this->registerService(EventDispatcher::class, function () { |
|
984 | + $this->registerService(EventDispatcher::class, function() { |
|
985 | 985 | return new EventDispatcher(); |
986 | 986 | }); |
987 | 987 | $this->registerAlias('EventDispatcher', EventDispatcher::class); |
988 | 988 | $this->registerAlias(EventDispatcherInterface::class, EventDispatcher::class); |
989 | 989 | |
990 | - $this->registerService('CryptoWrapper', function (Server $c) { |
|
990 | + $this->registerService('CryptoWrapper', function(Server $c) { |
|
991 | 991 | // FIXME: Instantiiated here due to cyclic dependency |
992 | 992 | $request = new Request( |
993 | 993 | [ |
@@ -1012,7 +1012,7 @@ discard block |
||
1012 | 1012 | $request |
1013 | 1013 | ); |
1014 | 1014 | }); |
1015 | - $this->registerService('CsrfTokenManager', function (Server $c) { |
|
1015 | + $this->registerService('CsrfTokenManager', function(Server $c) { |
|
1016 | 1016 | $tokenGenerator = new CsrfTokenGenerator($c->getSecureRandom()); |
1017 | 1017 | |
1018 | 1018 | return new CsrfTokenManager( |
@@ -1020,22 +1020,22 @@ discard block |
||
1020 | 1020 | $c->query(SessionStorage::class) |
1021 | 1021 | ); |
1022 | 1022 | }); |
1023 | - $this->registerService(SessionStorage::class, function (Server $c) { |
|
1023 | + $this->registerService(SessionStorage::class, function(Server $c) { |
|
1024 | 1024 | return new SessionStorage($c->getSession()); |
1025 | 1025 | }); |
1026 | - $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function (Server $c) { |
|
1026 | + $this->registerService(\OCP\Security\IContentSecurityPolicyManager::class, function(Server $c) { |
|
1027 | 1027 | return new ContentSecurityPolicyManager(); |
1028 | 1028 | }); |
1029 | 1029 | $this->registerAlias('ContentSecurityPolicyManager', \OCP\Security\IContentSecurityPolicyManager::class); |
1030 | 1030 | |
1031 | - $this->registerService('ContentSecurityPolicyNonceManager', function (Server $c) { |
|
1031 | + $this->registerService('ContentSecurityPolicyNonceManager', function(Server $c) { |
|
1032 | 1032 | return new ContentSecurityPolicyNonceManager( |
1033 | 1033 | $c->getCsrfTokenManager(), |
1034 | 1034 | $c->getRequest() |
1035 | 1035 | ); |
1036 | 1036 | }); |
1037 | 1037 | |
1038 | - $this->registerService(\OCP\Share\IManager::class, function (Server $c) { |
|
1038 | + $this->registerService(\OCP\Share\IManager::class, function(Server $c) { |
|
1039 | 1039 | $config = $c->getConfig(); |
1040 | 1040 | $factoryClass = $config->getSystemValue('sharing.managerFactory', ProviderFactory::class); |
1041 | 1041 | /** @var \OCP\Share\IProviderFactory $factory */ |
@@ -1078,7 +1078,7 @@ discard block |
||
1078 | 1078 | |
1079 | 1079 | $this->registerAlias(\OCP\Collaboration\AutoComplete\IManager::class, \OC\Collaboration\AutoComplete\Manager::class); |
1080 | 1080 | |
1081 | - $this->registerService('SettingsManager', function (Server $c) { |
|
1081 | + $this->registerService('SettingsManager', function(Server $c) { |
|
1082 | 1082 | $manager = new \OC\Settings\Manager( |
1083 | 1083 | $c->getLogger(), |
1084 | 1084 | $c->getDatabaseConnection(), |
@@ -1096,36 +1096,36 @@ discard block |
||
1096 | 1096 | ); |
1097 | 1097 | return $manager; |
1098 | 1098 | }); |
1099 | - $this->registerService(\OC\Files\AppData\Factory::class, function (Server $c) { |
|
1099 | + $this->registerService(\OC\Files\AppData\Factory::class, function(Server $c) { |
|
1100 | 1100 | return new \OC\Files\AppData\Factory( |
1101 | 1101 | $c->getRootFolder(), |
1102 | 1102 | $c->getSystemConfig() |
1103 | 1103 | ); |
1104 | 1104 | }); |
1105 | 1105 | |
1106 | - $this->registerService('LockdownManager', function (Server $c) { |
|
1107 | - return new LockdownManager(function () use ($c) { |
|
1106 | + $this->registerService('LockdownManager', function(Server $c) { |
|
1107 | + return new LockdownManager(function() use ($c) { |
|
1108 | 1108 | return $c->getSession(); |
1109 | 1109 | }); |
1110 | 1110 | }); |
1111 | 1111 | |
1112 | - $this->registerService(\OCP\OCS\IDiscoveryService::class, function (Server $c) { |
|
1112 | + $this->registerService(\OCP\OCS\IDiscoveryService::class, function(Server $c) { |
|
1113 | 1113 | return new DiscoveryService($c->getMemCacheFactory(), $c->getHTTPClientService()); |
1114 | 1114 | }); |
1115 | 1115 | |
1116 | - $this->registerService(ICloudIdManager::class, function (Server $c) { |
|
1116 | + $this->registerService(ICloudIdManager::class, function(Server $c) { |
|
1117 | 1117 | return new CloudIdManager(); |
1118 | 1118 | }); |
1119 | 1119 | |
1120 | - $this->registerService(IConfig::class, function (Server $c) { |
|
1120 | + $this->registerService(IConfig::class, function(Server $c) { |
|
1121 | 1121 | return new GlobalScale\Config($c->getConfig()); |
1122 | 1122 | }); |
1123 | 1123 | |
1124 | - $this->registerService(ICloudFederationProviderManager::class, function (Server $c) { |
|
1124 | + $this->registerService(ICloudFederationProviderManager::class, function(Server $c) { |
|
1125 | 1125 | return new CloudFederationProviderManager($c->getAppManager(), $c->getHTTPClientService(), $c->getCloudIdManager(), $c->getLogger()); |
1126 | 1126 | }); |
1127 | 1127 | |
1128 | - $this->registerService(ICloudFederationFactory::class, function (Server $c) { |
|
1128 | + $this->registerService(ICloudFederationFactory::class, function(Server $c) { |
|
1129 | 1129 | return new CloudFederationFactory(); |
1130 | 1130 | }); |
1131 | 1131 | |
@@ -1135,18 +1135,18 @@ discard block |
||
1135 | 1135 | $this->registerAlias(\OCP\AppFramework\Utility\ITimeFactory::class, \OC\AppFramework\Utility\TimeFactory::class); |
1136 | 1136 | $this->registerAlias('TimeFactory', \OCP\AppFramework\Utility\ITimeFactory::class); |
1137 | 1137 | |
1138 | - $this->registerService(Defaults::class, function (Server $c) { |
|
1138 | + $this->registerService(Defaults::class, function(Server $c) { |
|
1139 | 1139 | return new Defaults( |
1140 | 1140 | $c->getThemingDefaults() |
1141 | 1141 | ); |
1142 | 1142 | }); |
1143 | 1143 | $this->registerAlias('Defaults', \OCP\Defaults::class); |
1144 | 1144 | |
1145 | - $this->registerService(\OCP\ISession::class, function (SimpleContainer $c) { |
|
1145 | + $this->registerService(\OCP\ISession::class, function(SimpleContainer $c) { |
|
1146 | 1146 | return $c->query(\OCP\IUserSession::class)->getSession(); |
1147 | 1147 | }); |
1148 | 1148 | |
1149 | - $this->registerService(IShareHelper::class, function (Server $c) { |
|
1149 | + $this->registerService(IShareHelper::class, function(Server $c) { |
|
1150 | 1150 | return new ShareHelper( |
1151 | 1151 | $c->query(\OCP\Share\IManager::class) |
1152 | 1152 | ); |
@@ -1208,11 +1208,11 @@ discard block |
||
1208 | 1208 | // no avatar to remove |
1209 | 1209 | } catch (\Exception $e) { |
1210 | 1210 | // Ignore exceptions |
1211 | - $logger->info('Could not cleanup avatar of ' . $user->getUID()); |
|
1211 | + $logger->info('Could not cleanup avatar of '.$user->getUID()); |
|
1212 | 1212 | } |
1213 | 1213 | }); |
1214 | 1214 | |
1215 | - $dispatcher->addListener('OCP\IUser::changeUser', function (GenericEvent $e) { |
|
1215 | + $dispatcher->addListener('OCP\IUser::changeUser', function(GenericEvent $e) { |
|
1216 | 1216 | $manager = $this->getAvatarManager(); |
1217 | 1217 | /** @var IUser $user */ |
1218 | 1218 | $user = $e->getSubject(); |
@@ -1363,7 +1363,7 @@ discard block |
||
1363 | 1363 | * @deprecated since 9.2.0 use IAppData |
1364 | 1364 | */ |
1365 | 1365 | public function getAppFolder() { |
1366 | - $dir = '/' . \OC_App::getCurrentApp(); |
|
1366 | + $dir = '/'.\OC_App::getCurrentApp(); |
|
1367 | 1367 | $root = $this->getRootFolder(); |
1368 | 1368 | if (!$root->nodeExists($dir)) { |
1369 | 1369 | $folder = $root->newFolder($dir); |
@@ -1938,7 +1938,7 @@ discard block |
||
1938 | 1938 | /** |
1939 | 1939 | * @return \OCP\Collaboration\AutoComplete\IManager |
1940 | 1940 | */ |
1941 | - public function getAutoCompleteManager(){ |
|
1941 | + public function getAutoCompleteManager() { |
|
1942 | 1942 | return $this->query(IManager::class); |
1943 | 1943 | } |
1944 | 1944 |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | // for backward compatibility make sure that the remote url stored in the |
165 | 165 | // database ends with a trailing slash |
166 | 166 | if (substr($remote, -1) !== '/') { |
167 | - $remote = $remote . '/'; |
|
167 | + $remote = $remote.'/'; |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | $token = $share->getShareSecret(); |
@@ -190,16 +190,16 @@ discard block |
||
190 | 190 | } |
191 | 191 | |
192 | 192 | // FIXME this should be a method in the user management instead |
193 | - $this->logger->debug('shareWith before, ' . $shareWith, ['app' => 'files_sharing']); |
|
193 | + $this->logger->debug('shareWith before, '.$shareWith, ['app' => 'files_sharing']); |
|
194 | 194 | Util::emitHook( |
195 | 195 | '\OCA\Files_Sharing\API\Server2Server', |
196 | 196 | 'preLoginNameUsedAsUserName', |
197 | 197 | array('uid' => &$shareWith) |
198 | 198 | ); |
199 | - $this->logger->debug('shareWith after, ' . $shareWith, ['app' => 'files_sharing']); |
|
199 | + $this->logger->debug('shareWith after, '.$shareWith, ['app' => 'files_sharing']); |
|
200 | 200 | |
201 | 201 | if (!$this->userManager->userExists($shareWith)) { |
202 | - throw new ProviderCouldNotAddShareException('User does not exists', '',Http::STATUS_BAD_REQUEST); |
|
202 | + throw new ProviderCouldNotAddShareException('User does not exists', '', Http::STATUS_BAD_REQUEST); |
|
203 | 203 | } |
204 | 204 | |
205 | 205 | \OC_Util::setupFS($shareWith); |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | ->setType('remote_share') |
226 | 226 | ->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_RECEIVED, [$ownerFederatedId, trim($name, '/')]) |
227 | 227 | ->setAffectedUser($shareWith) |
228 | - ->setObject('remote_share', (int)$shareId, $name); |
|
228 | + ->setObject('remote_share', (int) $shareId, $name); |
|
229 | 229 | \OC::$server->getActivityManager()->publish($event); |
230 | 230 | |
231 | 231 | $notification = $this->notificationManager->createNotification(); |
@@ -237,12 +237,12 @@ discard block |
||
237 | 237 | |
238 | 238 | $declineAction = $notification->createAction(); |
239 | 239 | $declineAction->setLabel('decline') |
240 | - ->setLink($this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/' . $shareId)), 'DELETE'); |
|
240 | + ->setLink($this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/'.$shareId)), 'DELETE'); |
|
241 | 241 | $notification->addAction($declineAction); |
242 | 242 | |
243 | 243 | $acceptAction = $notification->createAction(); |
244 | 244 | $acceptAction->setLabel('accept') |
245 | - ->setLink($this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/' . $shareId)), 'POST'); |
|
245 | + ->setLink($this->urlGenerator->getAbsoluteURL($this->urlGenerator->linkTo('', 'ocs/v2.php/apps/files_sharing/api/v1/remote_shares/pending/'.$shareId)), 'POST'); |
|
246 | 246 | $notification->addAction($acceptAction); |
247 | 247 | |
248 | 248 | $this->notificationManager->notify($notification); |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | 'level' => ILogger::ERROR, |
255 | 255 | 'app' => 'files_sharing' |
256 | 256 | ]); |
257 | - throw new ProviderCouldNotAddShareException('internal server error, was not able to add share from ' . $remote, '', HTTP::STATUS_INTERNAL_SERVER_ERROR); |
|
257 | + throw new ProviderCouldNotAddShareException('internal server error, was not able to add share from '.$remote, '', HTTP::STATUS_INTERNAL_SERVER_ERROR); |
|
258 | 258 | } |
259 | 259 | } |
260 | 260 | |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | */ |
352 | 352 | protected function executeAcceptShare(IShare $share) { |
353 | 353 | try { |
354 | - $fileId = (int)$share->getNode()->getId(); |
|
354 | + $fileId = (int) $share->getNode()->getId(); |
|
355 | 355 | list($file, $link) = $this->getFile($this->getCorrectUid($share), $fileId); |
356 | 356 | } catch (\Exception $e) { |
357 | 357 | throw new ShareNotFound(); |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | $this->federatedShareProvider->removeShareFromTable($share); |
430 | 430 | |
431 | 431 | try { |
432 | - $fileId = (int)$share->getNode()->getId(); |
|
432 | + $fileId = (int) $share->getNode()->getId(); |
|
433 | 433 | list($file, $link) = $this->getFile($this->getCorrectUid($share), $fileId); |
434 | 434 | } catch (\Exception $e) { |
435 | 435 | throw new ShareNotFound(); |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | $notification = $this->notificationManager->createNotification(); |
531 | 531 | $notification->setApp('files_sharing') |
532 | 532 | ->setUser($share['user']) |
533 | - ->setObject('remote_share', (int)$share['id']); |
|
533 | + ->setObject('remote_share', (int) $share['id']); |
|
534 | 534 | $this->notificationManager->markProcessed($notification); |
535 | 535 | |
536 | 536 | $event = $this->activityManager->generateEvent(); |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | ->setType('remote_share') |
539 | 539 | ->setSubject(RemoteShares::SUBJECT_REMOTE_SHARE_UNSHARED, [$owner->getId(), $path]) |
540 | 540 | ->setAffectedUser($user) |
541 | - ->setObject('remote_share', (int)$share['id'], $path); |
|
541 | + ->setObject('remote_share', (int) $share['id'], $path); |
|
542 | 542 | \OC::$server->getActivityManager()->publish($event); |
543 | 543 | } |
544 | 544 | |
@@ -586,7 +586,7 @@ discard block |
||
586 | 586 | $owner = $share->getShareOwner(); |
587 | 587 | $currentServer = $this->addressHandler->generateRemoteURL(); |
588 | 588 | if ($this->addressHandler->compareAddresses($user, $remote, $owner, $currentServer)) { |
589 | - throw new ProviderCouldNotAddShareException('Resharing back to the owner is not allowed: ' . $id); |
|
589 | + throw new ProviderCouldNotAddShareException('Resharing back to the owner is not allowed: '.$id); |
|
590 | 590 | } |
591 | 591 | } catch (\Exception $e) { |
592 | 592 | throw new ProviderCouldNotAddShareException($e->getMessage()); |
@@ -600,10 +600,10 @@ discard block |
||
600 | 600 | $share->setSharedBy($share->getSharedWith()); |
601 | 601 | $share->setSharedWith($shareWith); |
602 | 602 | $result = $this->federatedShareProvider->create($share); |
603 | - $this->federatedShareProvider->storeRemoteId((int)$result->getId(), $senderId); |
|
603 | + $this->federatedShareProvider->storeRemoteId((int) $result->getId(), $senderId); |
|
604 | 604 | return ['token' => $result->getToken(), 'providerId' => $result->getId()]; |
605 | 605 | } else { |
606 | - throw new ProviderCouldNotAddShareException('resharing not allowed for share: ' . $id); |
|
606 | + throw new ProviderCouldNotAddShareException('resharing not allowed for share: '.$id); |
|
607 | 607 | } |
608 | 608 | |
609 | 609 | } |
@@ -649,7 +649,7 @@ discard block |
||
649 | 649 | */ |
650 | 650 | protected function ocmPermissions2ncPermissions(array $ocmPermissions) { |
651 | 651 | $ncPermissions = 0; |
652 | - foreach($ocmPermissions as $permission) { |
|
652 | + foreach ($ocmPermissions as $permission) { |
|
653 | 653 | switch (strtolower($permission)) { |
654 | 654 | case 'read': |
655 | 655 | $ncPermissions += Constants::PERMISSION_READ; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $secure = $protocol === 'https'; |
80 | 80 | $federatedSharingEndpoints = $discoveryService->discover($this->cloudId->getRemote(), 'FEDERATED_SHARING'); |
81 | 81 | $webDavEndpoint = isset($federatedSharingEndpoints['webdav']) ? $federatedSharingEndpoints['webdav'] : '/public.php/webdav'; |
82 | - $root = rtrim($root, '/') . $webDavEndpoint; |
|
82 | + $root = rtrim($root, '/').$webDavEndpoint; |
|
83 | 83 | $this->mountPoint = $options['mountpoint']; |
84 | 84 | $this->token = $options['token']; |
85 | 85 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | 'host' => $host, |
89 | 89 | 'root' => $root, |
90 | 90 | 'user' => $options['token'], |
91 | - 'password' => (string)$options['password'] |
|
91 | + 'password' => (string) $options['password'] |
|
92 | 92 | )); |
93 | 93 | } |
94 | 94 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | * @return string |
129 | 129 | */ |
130 | 130 | public function getId() { |
131 | - return 'shared::' . md5($this->token . '@' . $this->getRemote()); |
|
131 | + return 'shared::'.md5($this->token.'@'.$this->getRemote()); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | public function getCache($path = '', $storage = null) { |
@@ -249,9 +249,9 @@ discard block |
||
249 | 249 | */ |
250 | 250 | protected function testRemote() { |
251 | 251 | try { |
252 | - return $this->testRemoteUrl($this->getRemote() . '/ocs-provider/index.php') |
|
253 | - || $this->testRemoteUrl($this->getRemote() . '/ocs-provider/') |
|
254 | - || $this->testRemoteUrl($this->getRemote() . '/status.php'); |
|
252 | + return $this->testRemoteUrl($this->getRemote().'/ocs-provider/index.php') |
|
253 | + || $this->testRemoteUrl($this->getRemote().'/ocs-provider/') |
|
254 | + || $this->testRemoteUrl($this->getRemote().'/status.php'); |
|
255 | 255 | } catch (\Exception $e) { |
256 | 256 | return false; |
257 | 257 | } |
@@ -263,8 +263,8 @@ discard block |
||
263 | 263 | */ |
264 | 264 | private function testRemoteUrl($url) { |
265 | 265 | $cache = $this->memcacheFactory->createDistributed('files_sharing_remote_url'); |
266 | - if($cache->hasKey($url)) { |
|
267 | - return (bool)$cache->get($url); |
|
266 | + if ($cache->hasKey($url)) { |
|
267 | + return (bool) $cache->get($url); |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | $client = $this->httpClient->newClient(); |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | $returnValue = false; |
282 | 282 | } |
283 | 283 | |
284 | - $cache->set($url, $returnValue, 60*60*24); |
|
284 | + $cache->set($url, $returnValue, 60 * 60 * 24); |
|
285 | 285 | return $returnValue; |
286 | 286 | } |
287 | 287 | |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | * @return bool |
293 | 293 | */ |
294 | 294 | public function remoteIsOwnCloud() { |
295 | - if(defined('PHPUNIT_RUN') || !$this->testRemoteUrl($this->getRemote() . '/status.php')) { |
|
295 | + if (defined('PHPUNIT_RUN') || !$this->testRemoteUrl($this->getRemote().'/status.php')) { |
|
296 | 296 | return false; |
297 | 297 | } |
298 | 298 | return true; |
@@ -310,11 +310,11 @@ discard block |
||
310 | 310 | $password = $this->getPassword(); |
311 | 311 | |
312 | 312 | // If remote is not an ownCloud do not try to get any share info |
313 | - if(!$this->remoteIsOwnCloud()) { |
|
313 | + if (!$this->remoteIsOwnCloud()) { |
|
314 | 314 | return ['status' => 'unsupported']; |
315 | 315 | } |
316 | 316 | |
317 | - $url = rtrim($remote, '/') . '/index.php/apps/files_sharing/shareinfo?t=' . $token; |
|
317 | + $url = rtrim($remote, '/').'/index.php/apps/files_sharing/shareinfo?t='.$token; |
|
318 | 318 | |
319 | 319 | // TODO: DI |
320 | 320 | $client = \OC::$server->getHTTPClientService()->newClient(); |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | try { |
383 | 383 | $ocmPermissions = json_decode($ocmPermissions); |
384 | 384 | $ncPermissions = 0; |
385 | - foreach($ocmPermissions as $permission) { |
|
385 | + foreach ($ocmPermissions as $permission) { |
|
386 | 386 | switch (strtolower($permission)) { |
387 | 387 | case 'read': |
388 | 388 | $ncPermissions += Constants::PERMISSION_READ; |