@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | if ($check) { |
509 | 509 | $user = $this->userManager->get($userId); |
510 | 510 | if ($user === null) { |
511 | - throw new FederatedUserNotFoundException('user ' . $userId . ' not found'); |
|
511 | + throw new FederatedUserNotFoundException('user '.$userId.' not found'); |
|
512 | 512 | } |
513 | 513 | $displayName = $this->userManager->getDisplayName($userId); |
514 | 514 | } else { |
@@ -1023,7 +1023,7 @@ discard block |
||
1023 | 1023 | $prefix = ($federatedUser->getUserType() === Member::TYPE_APP) ? 'app' |
1024 | 1024 | : Member::$TYPE[$federatedUser->getUserType()]; |
1025 | 1025 | |
1026 | - $circle->setName($prefix . ':' . $federatedUser->getUserId() . ':' . $id) |
|
1026 | + $circle->setName($prefix.':'.$federatedUser->getUserId().':'.$id) |
|
1027 | 1027 | ->setDisplayName($federatedUser->getDisplayName()) |
1028 | 1028 | ->setSingleId($id) |
1029 | 1029 | ->setSource($source); |
@@ -1227,7 +1227,7 @@ discard block |
||
1227 | 1227 | $owner = $this->getCurrentApp(); |
1228 | 1228 | |
1229 | 1229 | $circle = new Circle(); |
1230 | - $circle->setName('group:' . $groupId) |
|
1230 | + $circle->setName('group:'.$groupId) |
|
1231 | 1231 | ->setConfig(Circle::CFG_SYSTEM | Circle::CFG_NO_OWNER | Circle::CFG_HIDDEN) |
1232 | 1232 | ->setSingleId($this->token(ManagedModel::ID_LENGTH)) |
1233 | 1233 | ->setSource(Member::TYPE_GROUP); |
@@ -1295,8 +1295,8 @@ discard block |
||
1295 | 1295 | * @return string |
1296 | 1296 | */ |
1297 | 1297 | private function generateCacheKey(FederatedUser $federatedUser): string { |
1298 | - return $federatedUser->getInstance() . '#' |
|
1299 | - . $federatedUser->getUserType() . '#' |
|
1298 | + return $federatedUser->getInstance().'#' |
|
1299 | + . $federatedUser->getUserType().'#' |
|
1300 | 1300 | . $federatedUser->getUserId(); |
1301 | 1301 | } |
1302 | 1302 | } |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | // $app->setAlgorithm(NCSignatory::SHA512); |
267 | 267 | $signedRequest = $this->signOutgoingRequest($request, $app); |
268 | 268 | $this->doRequest($signedRequest->getOutgoingRequest(), false); |
269 | - } catch (RequestNetworkException|SignatoryException $e) { |
|
269 | + } catch (RequestNetworkException | SignatoryException $e) { |
|
270 | 270 | throw new RemoteInstanceException($e->getMessage()); |
271 | 271 | } |
272 | 272 | |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | public function getCachedRemoteInstance(string $instance): RemoteInstance { |
311 | 311 | $remoteInstance = $this->remoteRequest->getFromInstance($instance); |
312 | 312 | if ($remoteInstance->getType() === RemoteInstance::TYPE_UNKNOWN) { |
313 | - throw new UnknownRemoteException($instance . ' is set as \'unknown\' in database'); |
|
313 | + throw new UnknownRemoteException($instance.' is set as \'unknown\' in database'); |
|
314 | 314 | } |
315 | 315 | |
316 | 316 | return $remoteInstance; |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | $test = new ReflectionClass($class); |
500 | 500 | $this->confirmFederatedItemExceptionFromClass($test); |
501 | 501 | $e = $class; |
502 | - } catch (ReflectionException|FederatedItemException $_e) { |
|
502 | + } catch (ReflectionException | FederatedItemException $_e) { |
|
503 | 503 | $e = $this->getFederatedItemExceptionFromStatus($result->getStatusCode()); |
504 | 504 | } |
505 | 505 | |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | * @throws RemoteNotFoundException |
554 | 554 | * @throws RemoteUidException |
555 | 555 | */ |
556 | - public function confirmValidRemote(RemoteInstance $remote, ?RemoteInstance &$stored = null): void { |
|
556 | + public function confirmValidRemote(RemoteInstance $remote, ?RemoteInstance & $stored = null): void { |
|
557 | 557 | try { |
558 | 558 | $stored = $this->remoteRequest->getFromHref($remote->getId()); |
559 | 559 | } catch (RemoteNotFoundException $e) { |
@@ -324,8 +324,8 @@ |
||
324 | 324 | int $nodeId, |
325 | 325 | string $probeSum, |
326 | 326 | ): string { |
327 | - return $federatedUser->getSingleId() . '#' |
|
328 | - . $nodeId . '#' |
|
327 | + return $federatedUser->getSingleId().'#' |
|
328 | + . $nodeId.'#' |
|
329 | 329 | . $probeSum; |
330 | 330 | } |
331 | 331 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | |
92 | 92 | try { |
93 | 93 | $this->circleRequest->getFederatedUserBySingleId($singleId); |
94 | - } catch (FederatedUserNotFoundException|OwnerNotFoundException $e) { |
|
94 | + } catch (FederatedUserNotFoundException | OwnerNotFoundException $e) { |
|
95 | 95 | $this->membershipRequest->removeBySingleId($singleId); |
96 | 96 | } |
97 | 97 | |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | */ |
243 | 243 | private function getChildrenMembers(string $id, array &$knownIds = []): array { |
244 | 244 | $singleIds = array_map( |
245 | - function (Member $item): string { |
|
245 | + function(Member $item): string { |
|
246 | 246 | return $item->getSingleId(); |
247 | 247 | }, $this->memberRequest->getMembers($id) |
248 | 248 | ); |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | */ |
267 | 267 | private function getChildrenMemberships(string $id, array &$knownIds = []): array { |
268 | 268 | $singleIds = array_map( |
269 | - function (Membership $item): string { |
|
269 | + function(Membership $item): string { |
|
270 | 270 | return $item->getSingleId(); |
271 | 271 | }, $this->membershipRequest->getInherited($id) |
272 | 272 | ); |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | */ |
321 | 321 | private function removeDeprecatedMemberships(array $memberships, array $known): array { |
322 | 322 | $circleIds = array_map( |
323 | - function (Membership $membership): string { |
|
323 | + function(Membership $membership): string { |
|
324 | 324 | return $membership->getCircleId(); |
325 | 325 | }, $memberships |
326 | 326 | ); |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | * @throws SingleCircleNotFoundException |
227 | 227 | */ |
228 | 228 | public function syncNextcloudUser(string $userId): FederatedUser { |
229 | - $this->outputService->output('Syncing Nextcloud Account \'' . $userId . '\'', true); |
|
229 | + $this->outputService->output('Syncing Nextcloud Account \''.$userId.'\'', true); |
|
230 | 230 | |
231 | 231 | return $this->federatedUserService->getLocalFederatedUser($userId, false, true); |
232 | 232 | } |
@@ -270,10 +270,10 @@ discard block |
||
270 | 270 | * @throws RequestBuilderException |
271 | 271 | */ |
272 | 272 | public function syncNextcloudGroup(string $groupId): Circle { |
273 | - $this->outputService->output('Syncing Nextcloud Group \'' . $groupId . '\'', true); |
|
273 | + $this->outputService->output('Syncing Nextcloud Group \''.$groupId.'\'', true); |
|
274 | 274 | |
275 | 275 | $circle = $this->federatedUserService->getGroupCircle($groupId); |
276 | - $members = array_map(function (Member $member): string { |
|
276 | + $members = array_map(function(Member $member): string { |
|
277 | 277 | return $member->getSingleId(); |
278 | 278 | }, $this->memberRequest->getMembers($circle->getSingleId())); |
279 | 279 | |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | */ |
352 | 352 | public function groupDeleted(string $groupId): void { |
353 | 353 | $circle = new Circle(); |
354 | - $circle->setName('group:' . $groupId) |
|
354 | + $circle->setName('group:'.$groupId) |
|
355 | 355 | ->setConfig(Circle::CFG_SYSTEM | Circle::CFG_NO_OWNER | Circle::CFG_HIDDEN) |
356 | 356 | ->setSource(Member::TYPE_GROUP); |
357 | 357 |
@@ -449,21 +449,21 @@ |
||
449 | 449 | /** @var FederatedUser $initiator */ |
450 | 450 | $initiator = $store->gObj('initiator', FederatedUser::class); |
451 | 451 | $this->federatedUserService->setCurrentUser($initiator); |
452 | - } catch (InvalidItemException|ItemNotFoundException $e) { |
|
452 | + } catch (InvalidItemException | ItemNotFoundException $e) { |
|
453 | 453 | } |
454 | 454 | |
455 | 455 | try { |
456 | 456 | /** @var FederatedUser $initiator */ |
457 | 457 | $filterMember = $store->gObj('filterMember', Member::class); |
458 | 458 | $data->aObj('filterMember', $filterMember); |
459 | - } catch (InvalidItemException|ItemNotFoundException $e) { |
|
459 | + } catch (InvalidItemException | ItemNotFoundException $e) { |
|
460 | 460 | } |
461 | 461 | |
462 | 462 | try { |
463 | 463 | /** @var FederatedUser $initiator */ |
464 | 464 | $filterCircle = $store->gObj('filterCircle', Circle::class); |
465 | 465 | $data->aObj('filterCircle', $filterCircle); |
466 | - } catch (InvalidItemException|ItemNotFoundException $e) { |
|
466 | + } catch (InvalidItemException | ItemNotFoundException $e) { |
|
467 | 467 | } |
468 | 468 | |
469 | 469 | return $data; |
@@ -64,7 +64,7 @@ |
||
64 | 64 | self::$tables[self::TABLE_MEMBER], |
65 | 65 | CoreQueryBuilder::MEMBER |
66 | 66 | ) |
67 | - ->orderBy(CoreQueryBuilder::MEMBER . '.joined'); |
|
67 | + ->orderBy(CoreQueryBuilder::MEMBER.'.joined'); |
|
68 | 68 | |
69 | 69 | if ($getBasedOn) { |
70 | 70 | $qb->leftJoinBasedOn(CoreQueryBuilder::MEMBER, $initiator); |
@@ -66,11 +66,11 @@ |
||
66 | 66 | try { |
67 | 67 | $users = $this->retrieveJson($request); |
68 | 68 | } catch ( |
69 | - RequestNetworkException| |
|
69 | + RequestNetworkException | |
|
70 | 70 | RequestResultNotJsonException $e |
71 | 71 | ) { |
72 | 72 | $this->miscService->log( |
73 | - 'Issue while search users from lookup: ' . get_class($e) . ' ' . $e->getMessage() |
|
73 | + 'Issue while search users from lookup: '.get_class($e).' '.$e->getMessage() |
|
74 | 74 | ); |
75 | 75 | |
76 | 76 | return []; |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | $l10n = \OCP\Server::get(IFactory::class)->get('circles'); |
438 | 438 | $display = $l10n->t('%s (Team owned by %s)', [$display, $circle->getOwner()->getDisplayName()]); |
439 | 439 | } else { |
440 | - $display .= ' (' . Circle::$DEF_SOURCE[$circle->getSource()] . ')'; |
|
440 | + $display .= ' ('.Circle::$DEF_SOURCE[$circle->getSource()].')'; |
|
441 | 441 | } |
442 | 442 | |
443 | 443 | $share->setSharedWithDisplayName($display); |
@@ -524,20 +524,20 @@ discard block |
||
524 | 524 | |
525 | 525 | public function importFromDatabase(array $data, string $prefix = ''): IQueryRow { |
526 | 526 | $shareTime = new DateTime(); |
527 | - $shareTime->setTimestamp($this->getInt($prefix . 'stime', $data)); |
|
528 | - |
|
529 | - $this->setId($this->get($prefix . 'id', $data)) |
|
530 | - ->setShareType($this->getInt($prefix . 'share_type', $data)) |
|
531 | - ->setPermissions($this->getInt($prefix . 'permissions', $data)) |
|
532 | - ->setItemType($this->get($prefix . 'item_type', $data)) |
|
533 | - ->setItemSource($this->getInt($prefix . 'item_source', $data)) |
|
534 | - ->setItemTarget($this->get($prefix . 'item_target', $data)) |
|
535 | - ->setFileSource($this->getInt($prefix . 'file_source', $data)) |
|
536 | - ->setFileTarget($this->get($prefix . 'file_target', $data)) |
|
537 | - ->setSharedWith($this->get($prefix . 'share_with', $data)) |
|
538 | - ->setSharedBy($this->get($prefix . 'uid_initiator', $data)) |
|
539 | - ->setShareOwner($this->get($prefix . 'uid_owner', $data)) |
|
540 | - ->setToken($this->get($prefix . 'token', $data)) |
|
527 | + $shareTime->setTimestamp($this->getInt($prefix.'stime', $data)); |
|
528 | + |
|
529 | + $this->setId($this->get($prefix.'id', $data)) |
|
530 | + ->setShareType($this->getInt($prefix.'share_type', $data)) |
|
531 | + ->setPermissions($this->getInt($prefix.'permissions', $data)) |
|
532 | + ->setItemType($this->get($prefix.'item_type', $data)) |
|
533 | + ->setItemSource($this->getInt($prefix.'item_source', $data)) |
|
534 | + ->setItemTarget($this->get($prefix.'item_target', $data)) |
|
535 | + ->setFileSource($this->getInt($prefix.'file_source', $data)) |
|
536 | + ->setFileTarget($this->get($prefix.'file_target', $data)) |
|
537 | + ->setSharedWith($this->get($prefix.'share_with', $data)) |
|
538 | + ->setSharedBy($this->get($prefix.'uid_initiator', $data)) |
|
539 | + ->setShareOwner($this->get($prefix.'uid_owner', $data)) |
|
540 | + ->setToken($this->get($prefix.'token', $data)) |
|
541 | 541 | ->setShareTime($shareTime); |
542 | 542 | |
543 | 543 | $this->importAttributesFromDatabase($this->get('attributes', $data)); |
@@ -548,9 +548,9 @@ discard block |
||
548 | 548 | // $share->setPassword($this->get('password', $data, '')); |
549 | 549 | // } |
550 | 550 | |
551 | - $this->setChildId($this->getInt($prefix . 'child_id', $data)) |
|
552 | - ->setChildFileTarget($this->get($prefix . 'child_file_target', $data)) |
|
553 | - ->setChildPermissions($this->getInt($prefix . 'child_permissions', $data)) |
|
551 | + $this->setChildId($this->getInt($prefix.'child_id', $data)) |
|
552 | + ->setChildFileTarget($this->get($prefix.'child_file_target', $data)) |
|
553 | + ->setChildPermissions($this->getInt($prefix.'child_permissions', $data)) |
|
554 | 554 | ->setProviderId(ShareByCircleProvider::IDENTIFIER) |
555 | 555 | ->setStatus(Ishare::STATUS_ACCEPTED); |
556 | 556 |