@@ -811,29 +811,29 @@ discard block |
||
811 | 811 | * @throws MemberNotFoundException |
812 | 812 | */ |
813 | 813 | public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow { |
814 | - if ($this->get($prefix . 'single_id', $data) === '') { |
|
814 | + if ($this->get($prefix.'single_id', $data) === '') { |
|
815 | 815 | throw new MemberNotFoundException(); |
816 | 816 | } |
817 | 817 | |
818 | - $this->setId($this->get($prefix . 'member_id', $data)); |
|
819 | - $this->setCircleId($this->get($prefix . 'circle_id', $data)); |
|
820 | - $this->setSingleId($this->get($prefix . 'single_id', $data)); |
|
821 | - $this->setUserId($this->get($prefix . 'user_id', $data)); |
|
822 | - $this->setUserType($this->getInt($prefix . 'user_type', $data)); |
|
823 | - $this->setInstance($this->get($prefix . 'instance', $data)); |
|
824 | - $this->setLevel($this->getInt($prefix . 'level', $data)); |
|
825 | - $this->setStatus($this->get($prefix . 'status', $data)); |
|
826 | - $this->setDisplayName($this->get($prefix . 'cached_name', $data)); |
|
827 | - $this->setNotes($this->getArray($prefix . 'note', $data)); |
|
828 | - $this->setContactId($this->get($prefix . 'contact_id', $data)); |
|
829 | - $this->setContactMeta($this->get($prefix . 'contact_meta', $data)); |
|
830 | - |
|
831 | - $cachedUpdate = $this->get($prefix . 'cached_update', $data); |
|
818 | + $this->setId($this->get($prefix.'member_id', $data)); |
|
819 | + $this->setCircleId($this->get($prefix.'circle_id', $data)); |
|
820 | + $this->setSingleId($this->get($prefix.'single_id', $data)); |
|
821 | + $this->setUserId($this->get($prefix.'user_id', $data)); |
|
822 | + $this->setUserType($this->getInt($prefix.'user_type', $data)); |
|
823 | + $this->setInstance($this->get($prefix.'instance', $data)); |
|
824 | + $this->setLevel($this->getInt($prefix.'level', $data)); |
|
825 | + $this->setStatus($this->get($prefix.'status', $data)); |
|
826 | + $this->setDisplayName($this->get($prefix.'cached_name', $data)); |
|
827 | + $this->setNotes($this->getArray($prefix.'note', $data)); |
|
828 | + $this->setContactId($this->get($prefix.'contact_id', $data)); |
|
829 | + $this->setContactMeta($this->get($prefix.'contact_meta', $data)); |
|
830 | + |
|
831 | + $cachedUpdate = $this->get($prefix.'cached_update', $data); |
|
832 | 832 | if ($cachedUpdate !== '') { |
833 | 833 | $this->setDisplayUpdate(DateTime::createFromFormat('Y-m-d H:i:s', $cachedUpdate)->getTimestamp()); |
834 | 834 | } |
835 | 835 | |
836 | - $joined = $this->get($prefix . 'joined', $data); |
|
836 | + $joined = $this->get($prefix.'joined', $data); |
|
837 | 837 | if ($joined !== '') { |
838 | 838 | $this->setJoined(DateTime::createFromFormat('Y-m-d H:i:s', $joined)->getTimestamp()); |
839 | 839 | } |
@@ -924,7 +924,7 @@ discard block |
||
924 | 924 | public static function parseLevelInt(int $level): int { |
925 | 925 | if (!array_key_exists($level, self::$DEF_LEVEL)) { |
926 | 926 | $all = implode(', ', array_keys(self::$DEF_LEVEL)); |
927 | - throw new ParseMemberLevelException('Available levels: ' . $all, 121); |
|
927 | + throw new ParseMemberLevelException('Available levels: '.$all, 121); |
|
928 | 928 | } |
929 | 929 | |
930 | 930 | return $level; |
@@ -943,7 +943,7 @@ discard block |
||
943 | 943 | |
944 | 944 | if (!$level) { |
945 | 945 | $all = implode(', ', array_values(self::$DEF_LEVEL)); |
946 | - throw new ParseMemberLevelException('Available levels: ' . $all, 121); |
|
946 | + throw new ParseMemberLevelException('Available levels: '.$all, 121); |
|
947 | 947 | } |
948 | 948 | |
949 | 949 | return (int)$level; |
@@ -964,7 +964,7 @@ discard block |
||
964 | 964 | $type = array_search($typeString, Member::$TYPE); |
965 | 965 | if ($type === false) { |
966 | 966 | $all = implode(', ', array_values(self::$TYPE)); |
967 | - throw new UserTypeNotFoundException('Available types: ' . $all); |
|
967 | + throw new UserTypeNotFoundException('Available types: '.$all); |
|
968 | 968 | } |
969 | 969 | |
970 | 970 | return (int)$type; |
@@ -400,15 +400,15 @@ |
||
400 | 400 | * @throws FederatedUserNotFoundException |
401 | 401 | */ |
402 | 402 | public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow { |
403 | - if ($this->get($prefix . 'single_id', $data) === '') { |
|
403 | + if ($this->get($prefix.'single_id', $data) === '') { |
|
404 | 404 | throw new FederatedUserNotFoundException(); |
405 | 405 | } |
406 | 406 | |
407 | - $this->setSingleId($this->get($prefix . 'single_id', $data)); |
|
408 | - $this->setUserId($this->get($prefix . 'user_id', $data)); |
|
409 | - $this->setUserType($this->getInt($prefix . 'user_type', $data)); |
|
410 | - $this->setDisplayName($this->get($prefix . 'cached_name', $data)); |
|
411 | - $this->setInstance($this->get($prefix . 'instance', $data)); |
|
407 | + $this->setSingleId($this->get($prefix.'single_id', $data)); |
|
408 | + $this->setUserId($this->get($prefix.'user_id', $data)); |
|
409 | + $this->setUserType($this->getInt($prefix.'user_type', $data)); |
|
410 | + $this->setDisplayName($this->get($prefix.'cached_name', $data)); |
|
411 | + $this->setInstance($this->get($prefix.'instance', $data)); |
|
412 | 412 | |
413 | 413 | $this->getManager()->manageImportFromDatabase($this, $data, $prefix); |
414 | 414 |
@@ -394,7 +394,7 @@ discard block |
||
394 | 394 | if ($check) { |
395 | 395 | $user = $this->userManager->get($userId); |
396 | 396 | if ($user === null) { |
397 | - throw new FederatedUserNotFoundException('user ' . $userId . ' not found'); |
|
397 | + throw new FederatedUserNotFoundException('user '.$userId.' not found'); |
|
398 | 398 | } |
399 | 399 | $userId = $user->getUID(); |
400 | 400 | $displayName = $user->getDisplayName(); |
@@ -852,7 +852,7 @@ discard block |
||
852 | 852 | $prefix = ($federatedUser->getUserType() === Member::TYPE_APP) ? 'app' |
853 | 853 | : Member::$TYPE[$federatedUser->getUserType()]; |
854 | 854 | |
855 | - $circle->setName($prefix . ':' . $federatedUser->getUserId() . ':' . $id) |
|
855 | + $circle->setName($prefix.':'.$federatedUser->getUserId().':'.$id) |
|
856 | 856 | ->setDisplayName($federatedUser->getDisplayName()) |
857 | 857 | ->setSingleId($id) |
858 | 858 | ->setSource($source); |
@@ -976,7 +976,7 @@ discard block |
||
976 | 976 | $owner = $this->getCurrentApp(); |
977 | 977 | |
978 | 978 | $circle = new Circle(); |
979 | - $circle->setName('group:' . $groupId) |
|
979 | + $circle->setName('group:'.$groupId) |
|
980 | 980 | ->setConfig(Circle::CFG_SYSTEM | Circle::CFG_NO_OWNER | Circle::CFG_HIDDEN) |
981 | 981 | ->setSingleId($this->token(ManagedModel::ID_LENGTH)) |
982 | 982 | ->setSource(Member::TYPE_GROUP); |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | |
497 | 497 | $i = 1; |
498 | 498 | while (true) { |
499 | - $testDisplayName = $baseDisplayName . (($i > 1) ? ' (' . $i . ')' : ''); |
|
499 | + $testDisplayName = $baseDisplayName.(($i > 1) ? ' ('.$i.')' : ''); |
|
500 | 500 | $test = new Circle(); |
501 | 501 | $test->setDisplayName($testDisplayName); |
502 | 502 | |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | |
530 | 530 | $i = 1; |
531 | 531 | while (true) { |
532 | - $testSanitizedName = $baseSanitizedName . (($i > 1) ? ' (' . $i . ')' : ''); |
|
532 | + $testSanitizedName = $baseSanitizedName.(($i > 1) ? ' ('.$i.')' : ''); |
|
533 | 533 | |
534 | 534 | $test = new Circle(); |
535 | 535 | $test->setSanitizedName($testSanitizedName); |
@@ -91,11 +91,11 @@ |
||
91 | 91 | |
92 | 92 | $circle = $event->getCircle(); |
93 | 93 | $member = $event->getMember(); |
94 | - $info .= 'circleId: ' . $circle->getSingleId() . '; userId: ' . $member->getUserId() . '; userType: ' |
|
95 | - . Member::$TYPE[$member->getUserType()] . '; singleId: ' . $member->getSingleId() |
|
96 | - . '; memberId: ' . $member->getId() . '; isLocal: ' . json_encode($member->isLocal()) . '; '; |
|
94 | + $info .= 'circleId: '.$circle->getSingleId().'; userId: '.$member->getUserId().'; userType: ' |
|
95 | + . Member::$TYPE[$member->getUserType()].'; singleId: '.$member->getSingleId() |
|
96 | + . '; memberId: '.$member->getId().'; isLocal: '.json_encode($member->isLocal()).'; '; |
|
97 | 97 | |
98 | - $this->log(3, $prefix . $info); |
|
98 | + $this->log(3, $prefix.$info); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | } |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | * @throws SingleCircleNotFoundException |
251 | 251 | */ |
252 | 252 | public function syncNextcloudUser(string $userId): FederatedUser { |
253 | - $this->outputService->output('Syncing Nextcloud User \'' . $userId . '\'', true); |
|
253 | + $this->outputService->output('Syncing Nextcloud User \''.$userId.'\'', true); |
|
254 | 254 | |
255 | 255 | return $this->federatedUserService->getLocalFederatedUser($userId); |
256 | 256 | } |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | * @throws RequestBuilderException |
295 | 295 | */ |
296 | 296 | public function syncNextcloudGroup(string $groupId): Circle { |
297 | - $this->outputService->output('Syncing Nextcloud Group \'' . $groupId . '\'', true); |
|
297 | + $this->outputService->output('Syncing Nextcloud Group \''.$groupId.'\'', true); |
|
298 | 298 | |
299 | 299 | $circle = $this->federatedUserService->getGroupCircle($groupId); |
300 | 300 | $group = $this->groupManager->get($groupId); |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | */ |
364 | 364 | public function groupDeleted(string $groupId): void { |
365 | 365 | $circle = new Circle(); |
366 | - $circle->setName('group:' . $groupId) |
|
366 | + $circle->setName('group:'.$groupId) |
|
367 | 367 | ->setConfig(Circle::CFG_SYSTEM | Circle::CFG_NO_OWNER | Circle::CFG_HIDDEN) |
368 | 368 | ->setSource(Member::TYPE_GROUP); |
369 | 369 |
@@ -82,14 +82,14 @@ |
||
82 | 82 | */ |
83 | 83 | public function output(string $message, bool $advance = false): void { |
84 | 84 | if (!is_null($this->occOutput)) { |
85 | - $this->occOutput->writeln((($advance) ? '+' : '-') . ' ' . $message); |
|
85 | + $this->occOutput->writeln((($advance) ? '+' : '-').' '.$message); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | if (!is_null($this->migrationOutput)) { |
89 | 89 | if ($advance) { |
90 | - $this->migrationOutput->advance(1, '(Circles) ' . $message); |
|
90 | + $this->migrationOutput->advance(1, '(Circles) '.$message); |
|
91 | 91 | } else { |
92 | - $this->migrationOutput->info('(Circles) ' . $message); |
|
92 | + $this->migrationOutput->info('(Circles) '.$message); |
|
93 | 93 | } |
94 | 94 | } |
95 | 95 | } |
@@ -226,7 +226,7 @@ |
||
226 | 226 | Circle::$DEF_SOURCE[$circle->getSource()], |
227 | 227 | $this->cut($displayName ? $owner->getDisplayName() : $owner->getUserId(), 40), |
228 | 228 | $this->configService->displayInstance($owner->getInstance()), |
229 | - $circle->getPopulation() . '/' . $this->getInt( |
|
229 | + $circle->getPopulation().'/'.$this->getInt( |
|
230 | 230 | 'members_limit', $circle->getSettings(), -1 |
231 | 231 | ) |
232 | 232 | ] |
@@ -189,11 +189,11 @@ discard block |
||
189 | 189 | $this->federatedUserService->commandLineInitiator($initiator, $initiatorType, $circleId, true); |
190 | 190 | $circle = $this->circleService->getCircle($circleId); |
191 | 191 | |
192 | - $output->writeln('<info>Name</info>: ' . $circle->getName()); |
|
192 | + $output->writeln('<info>Name</info>: '.$circle->getName()); |
|
193 | 193 | $owner = $circle->getOwner(); |
194 | - $output->writeln('<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance()); |
|
194 | + $output->writeln('<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance()); |
|
195 | 195 | $type = implode(", ", Circle::getCircleFlags($circle, Circle::FLAGS_LONG)); |
196 | - $output->writeln('<info>Config</info>: ' . $type); |
|
196 | + $output->writeln('<info>Config</info>: '.$type); |
|
197 | 197 | $output->writeln(' '); |
198 | 198 | |
199 | 199 | $tree = new NC22TreeNode(null, new SimpleDataStore(['circle' => $circle])); |
@@ -260,8 +260,7 @@ discard block |
||
260 | 260 | ), 40 |
261 | 261 | ), |
262 | 262 | $this->configService->displayInstance($member->getInstance()), |
263 | - ($level > 0) ? Member::$DEF_LEVEL[$level] : |
|
264 | - '(' . strtolower($member->getStatus()) . ')', |
|
263 | + ($level > 0) ? Member::$DEF_LEVEL[$level] : '('.strtolower($member->getStatus()).')', |
|
265 | 264 | ($member->hasInvitedBy()) ? $this->configService->displayFederatedUser( |
266 | 265 | $member->getInvitedBy(), $this->input->getOption('display-name') |
267 | 266 | ) : 'Unknown' |
@@ -423,19 +422,19 @@ discard block |
||
423 | 422 | $member = $data->gObj('member', Member::class); |
424 | 423 | |
425 | 424 | if ($lineNumber === 1) { |
426 | - $line .= '<info>' . $member->getSingleId() . '</info>'; |
|
425 | + $line .= '<info>'.$member->getSingleId().'</info>'; |
|
427 | 426 | if (!$this->configService->isLocalInstance($member->getInstance())) { |
428 | - $line .= '@' . $member->getInstance(); |
|
427 | + $line .= '@'.$member->getInstance(); |
|
429 | 428 | } |
430 | - $line .= ' (' . Member::$DEF_LEVEL[$member->getLevel()] . ')'; |
|
429 | + $line .= ' ('.Member::$DEF_LEVEL[$member->getLevel()].')'; |
|
431 | 430 | |
432 | - $line .= ' <info>MemberId</info>: ' . $member->getId(); |
|
433 | - $line .= ' <info>Name</info>: ' . $this->configService->displayFederatedUser( |
|
431 | + $line .= ' <info>MemberId</info>: '.$member->getId(); |
|
432 | + $line .= ' <info>Name</info>: '.$this->configService->displayFederatedUser( |
|
434 | 433 | $member, |
435 | 434 | $this->input->getOption('display-name') |
436 | 435 | ); |
437 | 436 | $source = ($member->hasBasedOn()) ? $member->getBasedOn()->getSource() : ''; |
438 | - $line .= ' <info>Source</info>: ' . Circle::$DEF_SOURCE[$source]; |
|
437 | + $line .= ' <info>Source</info>: '.Circle::$DEF_SOURCE[$source]; |
|
439 | 438 | } |
440 | 439 | |
441 | 440 | if ($lineNumber === 2) { |
@@ -447,16 +446,16 @@ discard block |
||
447 | 446 | return $line; |
448 | 447 | } |
449 | 448 | $owner = $circle->getOwner(); |
450 | - $line .= '<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance(); |
|
449 | + $line .= '<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance(); |
|
451 | 450 | $type = implode(", ", Circle::getCircleFlags($circle, Circle::FLAGS_LONG)); |
452 | - $line .= ($type === '') ? '' : ' <info>Config</info>: ' . $type; |
|
451 | + $line .= ($type === '') ? '' : ' <info>Config</info>: '.$type; |
|
453 | 452 | } |
454 | 453 | |
455 | 454 | } else { |
456 | 455 | if ($lineNumber === 1 && !is_null($circle)) { |
457 | - $line .= '<info>' . $circle->getSingleId() . '</info>'; |
|
456 | + $line .= '<info>'.$circle->getSingleId().'</info>'; |
|
458 | 457 | if (!$this->configService->isLocalInstance($circle->getInstance())) { |
459 | - $line .= '@' . $circle->getInstance(); |
|
458 | + $line .= '@'.$circle->getInstance(); |
|
460 | 459 | } |
461 | 460 | } |
462 | 461 | } |