@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | continue; |
127 | 127 | } |
128 | 128 | |
129 | - $replace['{' . $k . '}'] = $data[$k]['_parsed']; |
|
129 | + $replace['{'.$k.'}'] = $data[$k]['_parsed']; |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | $event->setParsedSubject(strtr($line, $replace)); |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | return [ |
271 | 271 | 'type' => Member::$TYPE[$member->getUserType()] ?? '', |
272 | 272 | 'id' => $member->getUserId(), |
273 | - 'name' => $member->getDisplayName() . ' (' . (Member::$TYPE[$member->getUserType()] ?? '') . ')', |
|
273 | + 'name' => $member->getDisplayName().' ('.(Member::$TYPE[$member->getUserType()] ?? '').')', |
|
274 | 274 | '_parsed' => $member->getDisplayName() |
275 | 275 | ]; |
276 | 276 | } |
@@ -75,7 +75,7 @@ |
||
75 | 75 | $event->setSubject('circle_create', ['circle' => json_encode($circle)]); |
76 | 76 | |
77 | 77 | $this->userManager->callForSeenUsers( |
78 | - function ($user) use ($event) { |
|
78 | + function($user) use ($event) { |
|
79 | 79 | /** @var IUser $user */ |
80 | 80 | $this->publishEvent($event, [$user]); |
81 | 81 | } |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | */ |
164 | 164 | public function result(FederatedEvent $event, array $results): void { |
165 | 165 | $member = $event->getMember(); |
166 | - \OC::$server->getLogger()->log(3, '>> ' . $member->getStatus()); |
|
166 | + \OC::$server->getLogger()->log(3, '>> '.$member->getStatus()); |
|
167 | 167 | if ($member->getStatus() === Member::STATUS_INVITED) { |
168 | 168 | $this->eventService->memberInvited($event, $results); |
169 | 169 | } else { |
@@ -197,10 +197,10 @@ discard block |
||
197 | 197 | protected function generateMember(FederatedEvent $event, Circle $circle, Member $member): Member { |
198 | 198 | try { |
199 | 199 | if ($member->getSingleId() !== '') { |
200 | - $userId = $member->getSingleId() . '@' . $member->getInstance(); |
|
200 | + $userId = $member->getSingleId().'@'.$member->getInstance(); |
|
201 | 201 | $federatedUser = $this->federatedUserService->getFederatedUser($userId, Member::TYPE_SINGLE); |
202 | 202 | } else { |
203 | - $userId = $member->getUserId() . '@' . $member->getInstance(); |
|
203 | + $userId = $member->getUserId().'@'.$member->getInstance(); |
|
204 | 204 | $federatedUser = $this->federatedUserService->getFederatedUser( |
205 | 205 | $userId, |
206 | 206 | $member->getUserType() |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | * @throws SingleCircleNotFoundException |
247 | 247 | */ |
248 | 248 | public function syncNextcloudUser(string $userId): FederatedUser { |
249 | - $this->outputService->output('Syncing Nextcloud Account \'' . $userId . '\'', true); |
|
249 | + $this->outputService->output('Syncing Nextcloud Account \''.$userId.'\'', true); |
|
250 | 250 | |
251 | 251 | return $this->federatedUserService->getLocalFederatedUser($userId, false, true); |
252 | 252 | } |
@@ -290,10 +290,10 @@ discard block |
||
290 | 290 | * @throws RequestBuilderException |
291 | 291 | */ |
292 | 292 | public function syncNextcloudGroup(string $groupId): Circle { |
293 | - $this->outputService->output('Syncing Nextcloud Group \'' . $groupId . '\'', true); |
|
293 | + $this->outputService->output('Syncing Nextcloud Group \''.$groupId.'\'', true); |
|
294 | 294 | |
295 | 295 | $circle = $this->federatedUserService->getGroupCircle($groupId); |
296 | - $members = array_map(function (Member $member): string { |
|
296 | + $members = array_map(function(Member $member): string { |
|
297 | 297 | return $member->getSingleId(); |
298 | 298 | }, $this->memberRequest->getMembers($circle->getSingleId())); |
299 | 299 | |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | */ |
372 | 372 | public function groupDeleted(string $groupId): void { |
373 | 373 | $circle = new Circle(); |
374 | - $circle->setName('group:' . $groupId) |
|
374 | + $circle->setName('group:'.$groupId) |
|
375 | 375 | ->setConfig(Circle::CFG_SYSTEM | Circle::CFG_NO_OWNER | Circle::CFG_HIDDEN) |
376 | 376 | ->setSource(Member::TYPE_GROUP); |
377 | 377 |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | if ($check) { |
529 | 529 | $user = $this->userManager->get($userId); |
530 | 530 | if ($user === null) { |
531 | - throw new FederatedUserNotFoundException('user ' . $userId . ' not found'); |
|
531 | + throw new FederatedUserNotFoundException('user '.$userId.' not found'); |
|
532 | 532 | } |
533 | 533 | $displayName = $this->userManager->getDisplayName($userId); |
534 | 534 | } else { |
@@ -1043,7 +1043,7 @@ discard block |
||
1043 | 1043 | $prefix = ($federatedUser->getUserType() === Member::TYPE_APP) ? 'app' |
1044 | 1044 | : Member::$TYPE[$federatedUser->getUserType()]; |
1045 | 1045 | |
1046 | - $circle->setName($prefix . ':' . $federatedUser->getUserId() . ':' . $id) |
|
1046 | + $circle->setName($prefix.':'.$federatedUser->getUserId().':'.$id) |
|
1047 | 1047 | ->setDisplayName($federatedUser->getDisplayName()) |
1048 | 1048 | ->setSingleId($id) |
1049 | 1049 | ->setSource($source); |
@@ -1247,7 +1247,7 @@ discard block |
||
1247 | 1247 | $owner = $this->getCurrentApp(); |
1248 | 1248 | |
1249 | 1249 | $circle = new Circle(); |
1250 | - $circle->setName('group:' . $groupId) |
|
1250 | + $circle->setName('group:'.$groupId) |
|
1251 | 1251 | ->setConfig(Circle::CFG_SYSTEM | Circle::CFG_NO_OWNER | Circle::CFG_HIDDEN) |
1252 | 1252 | ->setSingleId($this->token(ManagedModel::ID_LENGTH)) |
1253 | 1253 | ->setSource(Member::TYPE_GROUP); |
@@ -1315,8 +1315,8 @@ discard block |
||
1315 | 1315 | * @return string |
1316 | 1316 | */ |
1317 | 1317 | private function generateCacheKey(FederatedUser $federatedUser): string { |
1318 | - return $federatedUser->getInstance() . '#' |
|
1319 | - . $federatedUser->getUserType() . '#' |
|
1318 | + return $federatedUser->getInstance().'#' |
|
1319 | + . $federatedUser->getUserType().'#' |
|
1320 | 1320 | . $federatedUser->getUserId(); |
1321 | 1321 | } |
1322 | 1322 | } |
@@ -184,8 +184,8 @@ |
||
184 | 184 | $qb->filterCircles(CoreQueryBuilder::CIRCLE, $probe); |
185 | 185 | if (!is_null($initiator)) { |
186 | 186 | $qb->limitToInitiator(CoreQueryBuilder::CIRCLE, $initiator); |
187 | - $qb->orderBy($qb->generateAlias(CoreQueryBuilder::CIRCLE, CoreQueryBuilder::INITIATOR) . '.level', 'desc'); |
|
188 | - $qb->addOrderBy(CoreQueryBuilder::CIRCLE . '.display_name', 'asc'); |
|
187 | + $qb->orderBy($qb->generateAlias(CoreQueryBuilder::CIRCLE, CoreQueryBuilder::INITIATOR).'.level', 'desc'); |
|
188 | + $qb->addOrderBy(CoreQueryBuilder::CIRCLE.'.display_name', 'asc'); |
|
189 | 189 | } |
190 | 190 | if ($probe->hasFilterMember()) { |
191 | 191 | $qb->limitToDirectMembership(CoreQueryBuilder::CIRCLE, $probe->getFilterMember()); |
@@ -90,27 +90,27 @@ discard block |
||
90 | 90 | public const FLAGS_LONG = 2; |
91 | 91 | |
92 | 92 | // specific value |
93 | - public const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default. |
|
94 | - public const CFG_SINGLE = 1; // Circle with only one single member. |
|
95 | - public const CFG_PERSONAL = 2; // Personal circle, only the owner can see it. |
|
93 | + public const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default. |
|
94 | + public const CFG_SINGLE = 1; // Circle with only one single member. |
|
95 | + public const CFG_PERSONAL = 2; // Personal circle, only the owner can see it. |
|
96 | 96 | |
97 | 97 | // bitwise |
98 | - public const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited |
|
99 | - public const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it |
|
100 | - public const CFG_OPEN = 16; // Circle is open, people can join |
|
101 | - public const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted |
|
102 | - public const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator |
|
103 | - public const CFG_FRIEND = 128; // Members of the circle can invite their friends |
|
104 | - public const CFG_PROTECTED = 256; // Password protected to join/request |
|
105 | - public const CFG_NO_OWNER = 512; // no owner, only members |
|
106 | - public const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity |
|
107 | - public const CFG_BACKEND = 2048; // Fully hidden, only backend Circles |
|
108 | - public const CFG_LOCAL = 4096; // Local even on GlobalScale |
|
109 | - public const CFG_ROOT = 8192; // Circle cannot be inside another Circle |
|
110 | - public const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle |
|
111 | - public const CFG_FEDERATED = 32768; // Federated |
|
112 | - public const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle |
|
113 | - public const CFG_APP = 131072; // Some features are not available to the OCS API (ie. destroying Circle) |
|
98 | + public const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited |
|
99 | + public const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it |
|
100 | + public const CFG_OPEN = 16; // Circle is open, people can join |
|
101 | + public const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted |
|
102 | + public const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator |
|
103 | + public const CFG_FRIEND = 128; // Members of the circle can invite their friends |
|
104 | + public const CFG_PROTECTED = 256; // Password protected to join/request |
|
105 | + public const CFG_NO_OWNER = 512; // no owner, only members |
|
106 | + public const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity |
|
107 | + public const CFG_BACKEND = 2048; // Fully hidden, only backend Circles |
|
108 | + public const CFG_LOCAL = 4096; // Local even on GlobalScale |
|
109 | + public const CFG_ROOT = 8192; // Circle cannot be inside another Circle |
|
110 | + public const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle |
|
111 | + public const CFG_FEDERATED = 32768; // Federated |
|
112 | + public const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle |
|
113 | + public const CFG_APP = 131072; // Some features are not available to the OCS API (ie. destroying Circle) |
|
114 | 114 | public static $DEF_CFG_MAX = 262143; |
115 | 115 | |
116 | 116 | |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | */ |
480 | 480 | public function addInheritedMembers(array $members): self { |
481 | 481 | $knownIds = array_map( |
482 | - function (Member $member): string { |
|
482 | + function(Member $member): string { |
|
483 | 483 | return $member->getId(); |
484 | 484 | }, $this->inheritedMembers |
485 | 485 | ); |
@@ -893,25 +893,25 @@ discard block |
||
893 | 893 | * @throws CircleNotFoundException |
894 | 894 | */ |
895 | 895 | public function importFromDatabase(array $data, string $prefix = ''): IQueryRow { |
896 | - if ($this->get($prefix . 'unique_id', $data) === '') { |
|
896 | + if ($this->get($prefix.'unique_id', $data) === '') { |
|
897 | 897 | throw new CircleNotFoundException(); |
898 | 898 | } |
899 | 899 | |
900 | - $this->setSingleId($this->get($prefix . 'unique_id', $data)) |
|
901 | - ->setName($this->get($prefix . 'name', $data)) |
|
902 | - ->setDisplayName($this->get($prefix . 'display_name', $data)) |
|
903 | - ->setSanitizedName($this->get($prefix . 'sanitized_name', $data)) |
|
904 | - ->setConfig($this->getInt($prefix . 'config', $data)) |
|
905 | - ->setSource($this->getInt($prefix . 'source', $data)) |
|
906 | - ->setInstance($this->get($prefix . 'instance', $data)) |
|
907 | - ->setSettings($this->getArray($prefix . 'settings', $data)) |
|
908 | - ->setContactAddressBook($this->getInt($prefix . 'contact_addressbook', $data)) |
|
909 | - ->setContactGroupName($this->get($prefix . 'contact_groupname', $data)) |
|
910 | - ->setDescription($this->get($prefix . 'description', $data)); |
|
911 | - |
|
912 | - $creation = $this->get($prefix . 'creation', $data); |
|
900 | + $this->setSingleId($this->get($prefix.'unique_id', $data)) |
|
901 | + ->setName($this->get($prefix.'name', $data)) |
|
902 | + ->setDisplayName($this->get($prefix.'display_name', $data)) |
|
903 | + ->setSanitizedName($this->get($prefix.'sanitized_name', $data)) |
|
904 | + ->setConfig($this->getInt($prefix.'config', $data)) |
|
905 | + ->setSource($this->getInt($prefix.'source', $data)) |
|
906 | + ->setInstance($this->get($prefix.'instance', $data)) |
|
907 | + ->setSettings($this->getArray($prefix.'settings', $data)) |
|
908 | + ->setContactAddressBook($this->getInt($prefix.'contact_addressbook', $data)) |
|
909 | + ->setContactGroupName($this->get($prefix.'contact_groupname', $data)) |
|
910 | + ->setDescription($this->get($prefix.'description', $data)); |
|
911 | + |
|
912 | + $creation = $this->get($prefix.'creation', $data); |
|
913 | 913 | $dateTime = DateTime::createFromFormat('Y-m-d H:i:s', $creation); |
914 | - $timestamp = $dateTime ? $dateTime->getTimestamp() : (int) strtotime($creation); |
|
914 | + $timestamp = $dateTime ? $dateTime->getTimestamp() : (int)strtotime($creation); |
|
915 | 915 | $this->setCreation($timestamp); |
916 | 916 | |
917 | 917 | $this->setPopulation($this->getInt('population', $this->getSettings())); |
@@ -210,7 +210,7 @@ |
||
210 | 210 | $cursor->closeCursor(); |
211 | 211 | |
212 | 212 | if ($data === false) { |
213 | - throw new CircleDoesNotExistException($this->l10n->t('Team not found ' . $circleUniqueId)); |
|
213 | + throw new CircleDoesNotExistException($this->l10n->t('Team not found '.$circleUniqueId)); |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | $circle = $this->parseCirclesSelectSql($data); |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | $l10n = \OCP\Server::get(IFactory::class)->get('circles'); |
448 | 448 | $display = $l10n->t('%s (Team owned by %s)', [$display, $circle->getOwner()->getDisplayName()]); |
449 | 449 | } else { |
450 | - $display .= ' (' . Circle::$DEF_SOURCE[$circle->getSource()] . ')'; |
|
450 | + $display .= ' ('.Circle::$DEF_SOURCE[$circle->getSource()].')'; |
|
451 | 451 | } |
452 | 452 | |
453 | 453 | $share->setSharedWithDisplayName($display); |
@@ -551,20 +551,20 @@ discard block |
||
551 | 551 | |
552 | 552 | public function importFromDatabase(array $data, string $prefix = ''): IQueryRow { |
553 | 553 | $shareTime = new DateTime(); |
554 | - $shareTime->setTimestamp($this->getInt($prefix . 'stime', $data)); |
|
555 | - |
|
556 | - $this->setId($this->get($prefix . 'id', $data)) |
|
557 | - ->setShareType($this->getInt($prefix . 'share_type', $data)) |
|
558 | - ->setPermissions($this->getInt($prefix . 'permissions', $data)) |
|
559 | - ->setItemType($this->get($prefix . 'item_type', $data)) |
|
560 | - ->setItemSource($this->getInt($prefix . 'item_source', $data)) |
|
561 | - ->setItemTarget($this->get($prefix . 'item_target', $data)) |
|
562 | - ->setFileSource($this->getInt($prefix . 'file_source', $data)) |
|
563 | - ->setFileTarget($this->get($prefix . 'file_target', $data)) |
|
564 | - ->setSharedWith($this->get($prefix . 'share_with', $data)) |
|
565 | - ->setSharedBy($this->get($prefix . 'uid_initiator', $data)) |
|
566 | - ->setShareOwner($this->get($prefix . 'uid_owner', $data)) |
|
567 | - ->setToken($this->get($prefix . 'token', $data)) |
|
554 | + $shareTime->setTimestamp($this->getInt($prefix.'stime', $data)); |
|
555 | + |
|
556 | + $this->setId($this->get($prefix.'id', $data)) |
|
557 | + ->setShareType($this->getInt($prefix.'share_type', $data)) |
|
558 | + ->setPermissions($this->getInt($prefix.'permissions', $data)) |
|
559 | + ->setItemType($this->get($prefix.'item_type', $data)) |
|
560 | + ->setItemSource($this->getInt($prefix.'item_source', $data)) |
|
561 | + ->setItemTarget($this->get($prefix.'item_target', $data)) |
|
562 | + ->setFileSource($this->getInt($prefix.'file_source', $data)) |
|
563 | + ->setFileTarget($this->get($prefix.'file_target', $data)) |
|
564 | + ->setSharedWith($this->get($prefix.'share_with', $data)) |
|
565 | + ->setSharedBy($this->get($prefix.'uid_initiator', $data)) |
|
566 | + ->setShareOwner($this->get($prefix.'uid_owner', $data)) |
|
567 | + ->setToken($this->get($prefix.'token', $data)) |
|
568 | 568 | ->setShareTime($shareTime); |
569 | 569 | |
570 | 570 | $this->importAttributesFromDatabase($this->get('attributes', $data)); |
@@ -575,9 +575,9 @@ discard block |
||
575 | 575 | // $share->setPassword($this->get('password', $data, '')); |
576 | 576 | // } |
577 | 577 | |
578 | - $this->setChildId($this->getInt($prefix . 'child_id', $data)) |
|
579 | - ->setChildFileTarget($this->get($prefix . 'child_file_target', $data)) |
|
580 | - ->setChildPermissions($this->getInt($prefix . 'child_permissions', $data)) |
|
578 | + $this->setChildId($this->getInt($prefix.'child_id', $data)) |
|
579 | + ->setChildFileTarget($this->get($prefix.'child_file_target', $data)) |
|
580 | + ->setChildPermissions($this->getInt($prefix.'child_permissions', $data)) |
|
581 | 581 | ->setProviderId(ShareByCircleProvider::IDENTIFIER) |
582 | 582 | ->setStatus(Ishare::STATUS_ACCEPTED); |
583 | 583 |