@@ -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,12 +270,12 @@ 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 | 276 | $this->circleService->updateDisplayName($circle->getSingleId(), $this->groupManager->getDisplayName($groupId)); |
| 277 | 277 | |
| 278 | - $members = array_map(function (Member $member): string { |
|
| 278 | + $members = array_map(function(Member $member): string { |
|
| 279 | 279 | return $member->getSingleId(); |
| 280 | 280 | }, $this->memberRequest->getMembers($circle->getSingleId())); |
| 281 | 281 | |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | */ |
| 354 | 354 | public function groupDeleted(string $groupId): void { |
| 355 | 355 | $circle = new Circle(); |
| 356 | - $circle->setName('group:' . $groupId) |
|
| 356 | + $circle->setName('group:'.$groupId) |
|
| 357 | 357 | ->setConfig(Circle::CFG_SYSTEM | Circle::CFG_NO_OWNER | Circle::CFG_HIDDEN) |
| 358 | 358 | ->setSource(Member::TYPE_GROUP); |
| 359 | 359 | |
@@ -78,15 +78,15 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | $name = $rowCG['display_name']; |
| 80 | 80 | while (strlen($name) < 3) { |
| 81 | - $name = '_' . $name; |
|
| 81 | + $name = '_'.$name; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - $this->output->writeln('+ New Team <info>' . $name . '</info>, owned by <info>' . $ownerId . '</info>'); |
|
| 84 | + $this->output->writeln('+ New Team <info>'.$name.'</info>, owned by <info>'.$ownerId.'</info>'); |
|
| 85 | 85 | |
| 86 | 86 | // based on owner's userid, we create federateduser and a new circle |
| 87 | 87 | $owner = $this->cachedFed($ownerId); |
| 88 | 88 | if ($owner === null) { |
| 89 | - $this->output->writeln('<error>unknown user</error> ' . $ownerId); |
|
| 89 | + $this->output->writeln('<error>unknown user</error> '.$ownerId); |
|
| 90 | 90 | continue; |
| 91 | 91 | } |
| 92 | 92 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | try { |
| 96 | 96 | $circle = $this->circlesManager->createCircle($name); |
| 97 | 97 | } catch (\Exception $e) { |
| 98 | - $this->output->writeln('<error>' . get_class($e) . ' ' . $e->getMessage() . '</error> with data ' . json_encode($rowCG)); |
|
| 98 | + $this->output->writeln('<error>'.get_class($e).' '.$e->getMessage().'</error> with data '.json_encode($rowCG)); |
|
| 99 | 99 | $this->logger->log(2, 'error while creating circle', ['exception' => $e]); |
| 100 | 100 | $this->circlesManager->stopSession(); |
| 101 | 101 | continue; |
@@ -124,17 +124,17 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | $fedUser = $this->cachedFed($userId); |
| 126 | 126 | if ($fedUser === null) { |
| 127 | - $this->output->writeln('<error>unknown user</error> ' . $userId); |
|
| 127 | + $this->output->writeln('<error>unknown user</error> '.$userId); |
|
| 128 | 128 | continue; |
| 129 | 129 | } |
| 130 | - $this->output->writeln(' - new member <info>' . $userId . '</info>'); |
|
| 130 | + $this->output->writeln(' - new member <info>'.$userId.'</info>'); |
|
| 131 | 131 | |
| 132 | 132 | $member = $this->circlesManager->addMember($circle->getSingleId(), $fedUser); |
| 133 | 133 | if ($rowM['role'] === '1') { |
| 134 | 134 | $this->circlesManager->levelMember($member->getId(), Member::LEVEL_ADMIN); |
| 135 | 135 | } |
| 136 | 136 | } catch (\Exception $e) { |
| 137 | - $this->output->writeln('<error>' . get_class($e) . ' ' . $e->getMessage() . '</error>'); |
|
| 137 | + $this->output->writeln('<error>'.get_class($e).' '.$e->getMessage().'</error>'); |
|
| 138 | 138 | $this->logger->log(2, 'error while migrating custom group member', ['exception' => $e]); |
| 139 | 139 | } |
| 140 | 140 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | ->where($update->expr()->in('id', $update->createNamedParameter($shareIds, IQueryBuilder::PARAM_INT_ARRAY))); |
| 171 | 171 | |
| 172 | 172 | $count = $update->executeStatement(); |
| 173 | - $this->output->writeln('> ' . ((string)$count) . ' shares updated'); |
|
| 173 | + $this->output->writeln('> '.((string)$count).' shares updated'); |
|
| 174 | 174 | |
| 175 | 175 | $this->fixShareChildren($shareIds, $memberIds); |
| 176 | 176 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | try { |
| 187 | 187 | $this->fedList[$userId] = $this->circlesManager->getLocalFederatedUser($userId); |
| 188 | 188 | } catch (\Exception $e) { |
| 189 | - $this->logger->warning('unknown local user ' . $userId, ['exception' => $e]); |
|
| 189 | + $this->logger->warning('unknown local user '.$userId, ['exception' => $e]); |
|
| 190 | 190 | $this->fedList[$userId] = null; |
| 191 | 191 | } |
| 192 | 192 | } |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | $count += $update->executeStatement(); |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | - $this->output->writeln('> ' . ((string)$count) . ' children shares updated'); |
|
| 223 | + $this->output->writeln('> '.((string)$count).' children shares updated'); |
|
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | |
@@ -12,9 +12,9 @@ |
||
| 12 | 12 | |
| 13 | 13 | return RectorConfig::configure() |
| 14 | 14 | ->withPaths([ |
| 15 | - __DIR__ . '/appinfo', |
|
| 16 | - __DIR__ . '/lib', |
|
| 17 | - __DIR__ . '/tests/unit', |
|
| 15 | + __DIR__.'/appinfo', |
|
| 16 | + __DIR__.'/lib', |
|
| 17 | + __DIR__.'/tests/unit', |
|
| 18 | 18 | ]) |
| 19 | 19 | ->withImportNames(importShortClasses: false) |
| 20 | 20 | ->withSets([ |
@@ -241,16 +241,16 @@ discard block |
||
| 241 | 241 | try { |
| 242 | 242 | $test = new ReflectionClass($class); |
| 243 | 243 | } catch (ReflectionException $e) { |
| 244 | - throw new FederatedEventException('ReflectionException with ' . $class . ': ' . $e->getMessage()); |
|
| 244 | + throw new FederatedEventException('ReflectionException with '.$class.': '.$e->getMessage()); |
|
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | if (!in_array(IFederatedItem::class, $test->getInterfaceNames())) { |
| 248 | - throw new FederatedEventException($class . ' does not implements IFederatedItem'); |
|
| 248 | + throw new FederatedEventException($class.' does not implements IFederatedItem'); |
|
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | $item = Server::get($class); |
| 252 | 252 | if (!($item instanceof IFederatedItem)) { |
| 253 | - throw new FederatedEventException($class . ' not an IFederatedItem'); |
|
| 253 | + throw new FederatedEventException($class.' not an IFederatedItem'); |
|
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | if ($item instanceof IFederatedItemHighSeverity) { |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | $knownInstances = $this->memberRequest->getMemberInstances($circle->getSingleId()); |
| 449 | 449 | $instances = array_filter( |
| 450 | 450 | array_map( |
| 451 | - function (RemoteInstance $instance) use ($knownInstances) { |
|
| 451 | + function(RemoteInstance $instance) use ($knownInstances) { |
|
| 452 | 452 | if (!in_array($instance->getInstance(), $knownInstances)) { |
| 453 | 453 | return null; |
| 454 | 454 | } |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | if ($event->hasMember() |
| 464 | 464 | && !$this->configService->isLocalInstance($event->getMember()->getInstance())) { |
| 465 | 465 | $currentInstances = array_map( |
| 466 | - function (RemoteInstance $instance): string { |
|
| 466 | + function(RemoteInstance $instance): string { |
|
| 467 | 467 | return $instance->getInstance(); |
| 468 | 468 | }, $instances |
| 469 | 469 | ); |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | $this->configService = Server::get(ConfigService::class); |
| 116 | 116 | $this->miscService = Server::get(MiscService::class); |
| 117 | 117 | } catch (QueryException $e) { |
| 118 | - $this->logger->info('Circles: cannot init FileSharingBroadcaster - ' . $e->getMessage(), ['exception' => $e]); |
|
| 118 | + $this->logger->info('Circles: cannot init FileSharingBroadcaster - '.$e->getMessage(), ['exception' => $e]); |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | try { |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | |
| 261 | 261 | $allShares = $this->fileSharesRequest->getSharesForCircle($member->getCircleId()); |
| 262 | 262 | $knownShares = array_map( |
| 263 | - function (SharesToken $shareToken) { |
|
| 263 | + function(SharesToken $shareToken) { |
|
| 264 | 264 | return $shareToken->getShareId(); |
| 265 | 265 | }, |
| 266 | 266 | $this->tokensRequest->getTokensFromMember($member) |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | * @throws IllegalIDChangeException |
| 308 | 308 | */ |
| 309 | 309 | private function generateShare($data): IShare { |
| 310 | - $this->logger->log(0, 'Regenerate shares from payload: ' . json_encode($data)); |
|
| 310 | + $this->logger->log(0, 'Regenerate shares from payload: '.json_encode($data)); |
|
| 311 | 311 | |
| 312 | 312 | $share = new Share($this->rootFolder, $this->userManager); |
| 313 | 313 | $share->setId($data['id']); |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | ); |
| 400 | 400 | $this->sendPasswordByMail($share, $displayName, $email, $password); |
| 401 | 401 | } catch (Exception $e) { |
| 402 | - $this->logger->info('Circles::sharedByMail - mail were not sent: ' . $e->getMessage(), ['exception' => $e]); |
|
| 402 | + $this->logger->info('Circles::sharedByMail - mail were not sent: '.$e->getMessage(), ['exception' => $e]); |
|
| 403 | 403 | } |
| 404 | 404 | } |
| 405 | 405 | |
@@ -417,8 +417,8 @@ discard block |
||
| 417 | 417 | $message = $this->mailer->createMessage(); |
| 418 | 418 | |
| 419 | 419 | $this->logger->log( |
| 420 | - 0, "Sending mail to circle '" . $circleName . "': " . $email . ' file: ' . $fileName |
|
| 421 | - . ' - link: ' . $link |
|
| 420 | + 0, "Sending mail to circle '".$circleName."': ".$email.' file: '.$fileName |
|
| 421 | + . ' - link: '.$link |
|
| 422 | 422 | ); |
| 423 | 423 | |
| 424 | 424 | $subject = $this->l10n->t('%s shared »%s« with you.', [$author, $fileName]); |
@@ -456,7 +456,7 @@ discard block |
||
| 456 | 456 | |
| 457 | 457 | $message = $this->mailer->createMessage(); |
| 458 | 458 | |
| 459 | - $this->logger->log(0, "Sending password mail to circle '" . $circleName . "': " . $email); |
|
| 459 | + $this->logger->log(0, "Sending password mail to circle '".$circleName."': ".$email); |
|
| 460 | 460 | |
| 461 | 461 | $filename = $share->getNode() |
| 462 | 462 | ->getName(); |
@@ -511,7 +511,7 @@ discard block |
||
| 511 | 511 | $message->setFrom([Util::getDefaultEmailAddress($instanceName) => $senderName]); |
| 512 | 512 | if ($initiatorEmailAddress !== null) { |
| 513 | 513 | $message->setReplyTo([$initiatorEmailAddress => $initiatorDisplayName]); |
| 514 | - $emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan()); |
|
| 514 | + $emailTemplate->addFooter($instanceName.' - '.$this->defaults->getSlogan()); |
|
| 515 | 515 | } else { |
| 516 | 516 | $emailTemplate->addFooter(); |
| 517 | 517 | } |
@@ -546,7 +546,7 @@ discard block |
||
| 546 | 546 | $emailTemplate->addHeader(); |
| 547 | 547 | $emailTemplate->addHeading($subject, false); |
| 548 | 548 | $emailTemplate->addBodyText( |
| 549 | - htmlspecialchars($text) . '<br>' . htmlspecialchars( |
|
| 549 | + htmlspecialchars($text).'<br>'.htmlspecialchars( |
|
| 550 | 550 | $this->l10n->t('Click the button below to open it.') |
| 551 | 551 | ), $text |
| 552 | 552 | ); |
@@ -592,7 +592,7 @@ discard block |
||
| 592 | 592 | $this->sendMailExistingShares($template, $author->getCachedName(), $recipient); |
| 593 | 593 | $this->sendPasswordExistingShares($author, $recipient, $password); |
| 594 | 594 | } catch (Exception $e) { |
| 595 | - $this->logger->log(2, 'Failed to send mail about existing share ' . $e->getMessage()); |
|
| 595 | + $this->logger->log(2, 'Failed to send mail about existing share '.$e->getMessage()); |
|
| 596 | 596 | } |
| 597 | 597 | } |
| 598 | 598 | |
@@ -615,7 +615,7 @@ discard block |
||
| 615 | 615 | $authorName = ($authorUser instanceof IUser) ? $authorUser->getDisplayName() : $author; |
| 616 | 616 | $authorEmail = ($authorUser instanceof IUser) ? $authorUser->getEMailAddress() : null; |
| 617 | 617 | |
| 618 | - $this->logger->log(0, "Sending password mail about existing files to '" . $email . "'"); |
|
| 618 | + $this->logger->log(0, "Sending password mail about existing files to '".$email."'"); |
|
| 619 | 619 | |
| 620 | 620 | $plainBodyPart = $this->l10n->t( |
| 621 | 621 | "%1\$s shared multiple files with you.\nYou should have already received a separate email with a link to access them.\n", |
@@ -657,7 +657,7 @@ discard block |
||
| 657 | 657 | $message->setFrom([Util::getDefaultEmailAddress($instanceName) => $senderName]); |
| 658 | 658 | if ($authorEmail !== null) { |
| 659 | 659 | $message->setReplyTo([$authorEmail => $authorName]); |
| 660 | - $emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan()); |
|
| 660 | + $emailTemplate->addFooter($instanceName.' - '.$this->defaults->getSlogan()); |
|
| 661 | 661 | } else { |
| 662 | 662 | $emailTemplate->addFooter(); |
| 663 | 663 | } |
@@ -702,7 +702,7 @@ discard block |
||
| 702 | 702 | */ |
| 703 | 703 | protected function generateMailExitingShares($author, $circleName) { |
| 704 | 704 | $this->logger->log( |
| 705 | - 0, "Generating mail about existing share mail from '" . $author . "' in " |
|
| 705 | + 0, "Generating mail about existing share mail from '".$author."' in " |
|
| 706 | 706 | . $circleName |
| 707 | 707 | ); |
| 708 | 708 | |
@@ -133,7 +133,7 @@ |
||
| 133 | 133 | public function boot(IBootContext $context): void { |
| 134 | 134 | $serverContainer = $context->getServerContainer(); |
| 135 | 135 | |
| 136 | - $context->injectFn(function (IShareManager $shareManager) { |
|
| 136 | + $context->injectFn(function(IShareManager $shareManager) { |
|
| 137 | 137 | $shareManager->registerShareProvider(ShareByCircleProvider::class); |
| 138 | 138 | }); |
| 139 | 139 | |
@@ -236,9 +236,9 @@ |
||
| 236 | 236 | Circle::$DEF_SOURCE[$circle->getSource()], |
| 237 | 237 | $this->cut($displayName ? $owner->getDisplayName() : $owner->getUserId(), 40), |
| 238 | 238 | $this->configService->displayInstance($owner->getInstance()), |
| 239 | - ((string)$circle->getPopulation()) . '/' |
|
| 239 | + ((string)$circle->getPopulation()).'/' |
|
| 240 | 240 | . ((string)$this->getInt('members_limit', $circle->getSettings(), -1)) |
| 241 | - . ' (' . ((string)$circle->getPopulationInherited()) . ')' |
|
| 241 | + . ' ('.((string)$circle->getPopulationInherited()).')' |
|
| 242 | 242 | ]; |
| 243 | 243 | } |
| 244 | 244 | |
@@ -154,19 +154,19 @@ discard block |
||
| 154 | 154 | |
| 155 | 155 | $webfinger = $this->getWebfinger($host, Application::APP_SUBJECT); |
| 156 | 156 | if ($this->input->getOption('all')) { |
| 157 | - $this->output->writeln('- Webfinger on <info>' . $host . '</info>'); |
|
| 157 | + $this->output->writeln('- Webfinger on <info>'.$host.'</info>'); |
|
| 158 | 158 | $this->output->writeln(json_encode($webfinger, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); |
| 159 | 159 | $this->output->writeln(''); |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | if ($this->input->getOption('all')) { |
| 163 | 163 | $circleLink = $this->extractLink(Application::APP_REL, $webfinger); |
| 164 | - $this->output->writeln('- Information about Circles app on <info>' . $host . '</info>'); |
|
| 164 | + $this->output->writeln('- Information about Circles app on <info>'.$host.'</info>'); |
|
| 165 | 165 | $this->output->writeln(json_encode($circleLink, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); |
| 166 | 166 | $this->output->writeln(''); |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | - $this->output->writeln('- Available services on <info>' . $host . '</info>'); |
|
| 169 | + $this->output->writeln('- Available services on <info>'.$host.'</info>'); |
|
| 170 | 170 | foreach ($webfinger->getLinks() as $link) { |
| 171 | 171 | $app = $link->getProperty('name'); |
| 172 | 172 | $ver = $link->getProperty('version'); |
@@ -174,14 +174,14 @@ discard block |
||
| 174 | 174 | $app .= ' '; |
| 175 | 175 | } |
| 176 | 176 | if ($ver !== '') { |
| 177 | - $ver = 'v' . $ver; |
|
| 177 | + $ver = 'v'.$ver; |
|
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - $this->output->writeln(' * ' . $link->getRel() . ' ' . $app . $ver); |
|
| 180 | + $this->output->writeln(' * '.$link->getRel().' '.$app.$ver); |
|
| 181 | 181 | } |
| 182 | 182 | $this->output->writeln(''); |
| 183 | 183 | |
| 184 | - $this->output->writeln('- Resources related to Circles on <info>' . $host . '</info>'); |
|
| 184 | + $this->output->writeln('- Resources related to Circles on <info>'.$host.'</info>'); |
|
| 185 | 185 | $resource = $this->getResourceData($host, Application::APP_SUBJECT, Application::APP_REL); |
| 186 | 186 | $this->output->writeln(json_encode($resource, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); |
| 187 | 187 | $this->output->writeln(''); |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | $tempUid = $resource->g('uid'); |
| 191 | 191 | $this->output->writeln( |
| 192 | - '- Confirming UID=' . $tempUid . ' from parsed Signatory at <info>' . $host . '</info>' |
|
| 192 | + '- Confirming UID='.$tempUid.' from parsed Signatory at <info>'.$host.'</info>' |
|
| 193 | 193 | ); |
| 194 | 194 | |
| 195 | 195 | try { |
@@ -198,15 +198,15 @@ discard block |
||
| 198 | 198 | $this->output->writeln(' * No SignatureException: <info>Identity authed</info>'); |
| 199 | 199 | } catch (SignatureException $e) { |
| 200 | 200 | $this->output->writeln( |
| 201 | - '<error>' . $host . ' cannot auth its identity: ' . $e->getMessage() . '</error>' |
|
| 201 | + '<error>'.$host.' cannot auth its identity: '.$e->getMessage().'</error>' |
|
| 202 | 202 | ); |
| 203 | 203 | |
| 204 | 204 | return; |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | - $this->output->writeln(' * Found <info>' . $remoteSignatory->getUid() . '</info>'); |
|
| 207 | + $this->output->writeln(' * Found <info>'.$remoteSignatory->getUid().'</info>'); |
|
| 208 | 208 | if ($remoteSignatory->getUid(true) !== $tempUid) { |
| 209 | - $this->output->writeln('<error>looks like ' . $host . ' is faking its identity'); |
|
| 209 | + $this->output->writeln('<error>looks like '.$host.' is faking its identity'); |
|
| 210 | 210 | |
| 211 | 211 | return; |
| 212 | 212 | } |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | $this->output->writeln(''); |
| 215 | 215 | |
| 216 | 216 | $testUrl = $resource->g('test'); |
| 217 | - $this->output->writeln('- Testing signed payload on <info>' . $testUrl . '</info>'); |
|
| 217 | + $this->output->writeln('- Testing signed payload on <info>'.$testUrl.'</info>'); |
|
| 218 | 218 | |
| 219 | 219 | try { |
| 220 | 220 | $localSignatory = $this->remoteStreamService->getAppSignatory(); |
@@ -236,18 +236,18 @@ discard block |
||
| 236 | 236 | $this->output->writeln(''); |
| 237 | 237 | |
| 238 | 238 | $this->output->writeln(' * Clear Signature: '); |
| 239 | - $this->output->writeln('<comment>' . $signedRequest->getClearSignature() . '</comment>'); |
|
| 239 | + $this->output->writeln('<comment>'.$signedRequest->getClearSignature().'</comment>'); |
|
| 240 | 240 | $this->output->writeln(''); |
| 241 | 241 | |
| 242 | 242 | $this->output->writeln(' * Signed Signature (base64 encoded): '); |
| 243 | 243 | $this->output->writeln( |
| 244 | - '<comment>' . base64_encode($signedRequest->getSignedSignature()) . '</comment>' |
|
| 244 | + '<comment>'.base64_encode($signedRequest->getSignedSignature()).'</comment>' |
|
| 245 | 245 | ); |
| 246 | 246 | $this->output->writeln(''); |
| 247 | 247 | |
| 248 | 248 | $result = $signedRequest->getOutgoingRequest()->getResult(); |
| 249 | 249 | $code = $result->getStatusCode(); |
| 250 | - $this->output->writeln(' * Result: ' . (($code === 200) ? '<info>' . ((string)$code) . '</info>' : $code)); |
|
| 250 | + $this->output->writeln(' * Result: '.(($code === 200) ? '<info>'.((string)$code).'</info>' : $code)); |
|
| 251 | 251 | $this->output->writeln( |
| 252 | 252 | json_encode(json_decode($result->getContent(), true), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) |
| 253 | 253 | ); |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | $stored = new RemoteInstance(); |
| 270 | 270 | $this->remoteStreamService->confirmValidRemote($remoteSignatory, $stored); |
| 271 | 271 | $this->output->writeln( |
| 272 | - '<info>The remote instance ' . $host |
|
| 272 | + '<info>The remote instance '.$host |
|
| 273 | 273 | . ' is already known with this current identity</info>' |
| 274 | 274 | ); |
| 275 | 275 | |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | |
| 280 | 280 | if ($remoteSignatory->getType() !== $stored->getType()) { |
| 281 | 281 | $this->output->writeln( |
| 282 | - '- updating type from ' . $stored->getType() . ' to ' |
|
| 282 | + '- updating type from '.$stored->getType().' to ' |
|
| 283 | 283 | . $remoteSignatory->getType() |
| 284 | 284 | ); |
| 285 | 285 | $this->remoteStreamService->update( |
@@ -289,7 +289,7 @@ discard block |
||
| 289 | 289 | |
| 290 | 290 | if ($remoteSignatory->getInstance() !== $stored->getInstance()) { |
| 291 | 291 | $this->output->writeln( |
| 292 | - '- updating host from ' . $stored->getInstance() . ' to ' |
|
| 292 | + '- updating host from '.$stored->getInstance().' to ' |
|
| 293 | 293 | . $remoteSignatory->getInstance() |
| 294 | 294 | ); |
| 295 | 295 | $this->remoteStreamService->update( |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | } |
| 299 | 299 | if ($remoteSignatory->getId() !== $stored->getId()) { |
| 300 | 300 | $this->output->writeln( |
| 301 | - '- updating href/Id from ' . $stored->getId() . ' to ' |
|
| 301 | + '- updating href/Id from '.$stored->getId().' to ' |
|
| 302 | 302 | . $remoteSignatory->getId() |
| 303 | 303 | ); |
| 304 | 304 | $this->remoteStreamService->update($remoteSignatory, RemoteStreamService::UPDATE_HREF); |
@@ -323,10 +323,10 @@ discard block |
||
| 323 | 323 | $helper = $this->getHelper('question'); |
| 324 | 324 | |
| 325 | 325 | $this->output->writeln( |
| 326 | - 'The remote instance <info>' . $remoteSignatory->getInstance() . '</info> looks good.' |
|
| 326 | + 'The remote instance <info>'.$remoteSignatory->getInstance().'</info> looks good.' |
|
| 327 | 327 | ); |
| 328 | 328 | $question = new ConfirmationQuestion( |
| 329 | - 'Would you like to identify this remote instance as \'<comment>' . $remoteSignatory->getType() |
|
| 329 | + 'Would you like to identify this remote instance as \'<comment>'.$remoteSignatory->getType() |
|
| 330 | 330 | . '</comment>\' using interface \'<comment>' |
| 331 | 331 | . InterfaceService::$LIST_IFACE[$remoteSignatory->getInterface()] |
| 332 | 332 | . '</comment>\' ? (y/N) ', |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | $helper = $this->getHelper('question'); |
| 356 | 356 | |
| 357 | 357 | $this->output->writeln( |
| 358 | - 'The remote instance <info>' . $remoteSignatory->getInstance() |
|
| 358 | + 'The remote instance <info>'.$remoteSignatory->getInstance() |
|
| 359 | 359 | . '</info> is known but <error>its identity has changed.</error>' |
| 360 | 360 | ); |
| 361 | 361 | $this->output->writeln( |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | private function verifyGSInstances(): void { |
| 418 | 418 | $instances = $this->globalScaleService->getGlobalScaleInstances(); |
| 419 | 419 | $known = array_map( |
| 420 | - function (RemoteInstance $instance): string { |
|
| 420 | + function(RemoteInstance $instance): string { |
|
| 421 | 421 | return $instance->getInstance(); |
| 422 | 422 | }, $this->remoteRequest->getFromType(RemoteInstance::TYPE_GLOBALSCALE) |
| 423 | 423 | ); |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | * @param string $instance |
| 434 | 434 | */ |
| 435 | 435 | private function syncGSInstance(string $instance): void { |
| 436 | - $this->output->write('Adding <comment>' . $instance . '</comment>: '); |
|
| 436 | + $this->output->write('Adding <comment>'.$instance.'</comment>: '); |
|
| 437 | 437 | if ($this->configService->isLocalInstance($instance)) { |
| 438 | 438 | $this->output->writeln('<comment>instance is local</comment>'); |
| 439 | 439 | return; |
@@ -448,8 +448,8 @@ discard block |
||
| 448 | 448 | ); |
| 449 | 449 | $this->output->writeln('<info>ok</info>'); |
| 450 | 450 | } catch (Exception $e) { |
| 451 | - $msg = ($e->getMessage() === '') ? '' : ' (' . $e->getMessage() . ')'; |
|
| 452 | - $this->output->writeln('<error>' . get_class($e) . $msg . '</error>'); |
|
| 451 | + $msg = ($e->getMessage() === '') ? '' : ' ('.$e->getMessage().')'; |
|
| 452 | + $this->output->writeln('<error>'.get_class($e).$msg.'</error>'); |
|
| 453 | 453 | } |
| 454 | 454 | } |
| 455 | 455 | |
@@ -467,12 +467,12 @@ discard block |
||
| 467 | 467 | try { |
| 468 | 468 | $current = $this->remoteStreamService->retrieveRemoteInstance($instance->getInstance()); |
| 469 | 469 | if ($current->getUid(true) === $instance->getUid(true)) { |
| 470 | - $currentUid = '<info>' . $current->getUid(true) . '</info>'; |
|
| 470 | + $currentUid = '<info>'.$current->getUid(true).'</info>'; |
|
| 471 | 471 | } else { |
| 472 | - $currentUid = '<error>' . $current->getUid(true) . '</error>'; |
|
| 472 | + $currentUid = '<error>'.$current->getUid(true).'</error>'; |
|
| 473 | 473 | } |
| 474 | 474 | } catch (Exception $e) { |
| 475 | - $currentUid = '<error>' . $e->getMessage() . '</error>'; |
|
| 475 | + $currentUid = '<error>'.$e->getMessage().'</error>'; |
|
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | $rows[] = [ |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | } |
| 501 | 501 | } |
| 502 | 502 | |
| 503 | - throw new Exception('Unknown type: ' . implode(', ', RemoteInstance::$LIST_TYPE)); |
|
| 503 | + throw new Exception('Unknown type: '.implode(', ', RemoteInstance::$LIST_TYPE)); |
|
| 504 | 504 | } |
| 505 | 505 | |
| 506 | 506 | /** |
@@ -513,6 +513,6 @@ discard block |
||
| 513 | 513 | } |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | - throw new Exception('Unknown interface: ' . implode(', ', InterfaceService::$LIST_IFACE)); |
|
| 516 | + throw new Exception('Unknown interface: '.implode(', ', InterfaceService::$LIST_IFACE)); |
|
| 517 | 517 | } |
| 518 | 518 | } |
@@ -167,11 +167,11 @@ discard block |
||
| 167 | 167 | $this->federatedUserService->commandLineInitiator($initiator, $initiatorType, $circleId, true); |
| 168 | 168 | $circle = $this->circleService->getCircle($circleId); |
| 169 | 169 | |
| 170 | - $output->writeln('<info>Name</info>: ' . $circle->getName()); |
|
| 170 | + $output->writeln('<info>Name</info>: '.$circle->getName()); |
|
| 171 | 171 | $owner = $circle->getOwner(); |
| 172 | - $output->writeln('<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance()); |
|
| 172 | + $output->writeln('<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance()); |
|
| 173 | 173 | $type = implode(', ', Circle::getCircleFlags($circle, Circle::FLAGS_LONG)); |
| 174 | - $output->writeln('<info>Config</info>: ' . $type); |
|
| 174 | + $output->writeln('<info>Config</info>: '.$type); |
|
| 175 | 175 | $output->writeln(' '); |
| 176 | 176 | |
| 177 | 177 | $tree = new TreeNode(null, new SimpleDataStore(['circle' => $circle])); |
@@ -235,8 +235,7 @@ discard block |
||
| 235 | 235 | $member, |
| 236 | 236 | $this->input->getOption('display-name') |
| 237 | 237 | ), |
| 238 | - ($level > 0) ? Member::$DEF_LEVEL[$level] : |
|
| 239 | - '(' . strtolower($member->getStatus()) . ')', |
|
| 238 | + ($level > 0) ? Member::$DEF_LEVEL[$level] : '('.strtolower($member->getStatus()).')', |
|
| 240 | 239 | ($member->hasInvitedBy()) ? $this->configService->displayFederatedUser( |
| 241 | 240 | $member->getInvitedBy(), |
| 242 | 241 | $this->input->getOption('display-name') |
@@ -328,7 +327,7 @@ discard block |
||
| 328 | 327 | $circle = $this->remoteService->getCircleFromInstance( |
| 329 | 328 | $member->getSingleId(), $member->getInstance(), $data |
| 330 | 329 | ); |
| 331 | - } catch (CircleNotFoundException|RemoteInstanceException $e) { |
|
| 330 | + } catch (CircleNotFoundException | RemoteInstanceException $e) { |
|
| 332 | 331 | } |
| 333 | 332 | } else { |
| 334 | 333 | $this->federatedUserService->commandLineInitiator( |
@@ -404,14 +403,14 @@ discard block |
||
| 404 | 403 | $member = $data->gObj('member', Member::class); |
| 405 | 404 | |
| 406 | 405 | if ($lineNumber === 1) { |
| 407 | - $line .= '<info>' . $member->getSingleId() . '</info>'; |
|
| 406 | + $line .= '<info>'.$member->getSingleId().'</info>'; |
|
| 408 | 407 | if (!$this->configService->isLocalInstance($member->getInstance())) { |
| 409 | - $line .= '@' . $member->getInstance(); |
|
| 408 | + $line .= '@'.$member->getInstance(); |
|
| 410 | 409 | } |
| 411 | - $line .= ' (' . Member::$DEF_LEVEL[$member->getLevel()] . ')'; |
|
| 410 | + $line .= ' ('.Member::$DEF_LEVEL[$member->getLevel()].')'; |
|
| 412 | 411 | |
| 413 | - $line .= ' <info>MemberId</info>: ' . $member->getId(); |
|
| 414 | - $line .= ' <info>Name</info>: ' . $this->configService->displayFederatedUser( |
|
| 412 | + $line .= ' <info>MemberId</info>: '.$member->getId(); |
|
| 413 | + $line .= ' <info>Name</info>: '.$this->configService->displayFederatedUser( |
|
| 415 | 414 | $member, |
| 416 | 415 | $this->input->getOption('display-name') |
| 417 | 416 | ); |
@@ -419,7 +418,7 @@ discard block |
||
| 419 | 418 | $line .= ' <info>Source</info>: ' |
| 420 | 419 | . Circle::$DEF_SOURCE[$member->getBasedOn()->getSource()]; |
| 421 | 420 | } else { |
| 422 | - $line .= ' <info>Type</info>: ' . Member::$TYPE[$member->getUserType()]; |
|
| 421 | + $line .= ' <info>Type</info>: '.Member::$TYPE[$member->getUserType()]; |
|
| 423 | 422 | } |
| 424 | 423 | } |
| 425 | 424 | |
@@ -432,21 +431,21 @@ discard block |
||
| 432 | 431 | return $line; |
| 433 | 432 | } |
| 434 | 433 | $owner = $circle->getOwner(); |
| 435 | - $line .= '<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance(); |
|
| 434 | + $line .= '<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance(); |
|
| 436 | 435 | $type = implode(', ', Circle::getCircleFlags($circle, Circle::FLAGS_LONG)); |
| 437 | - $line .= ($type === '') ? '' : ' <info>Config</info>: ' . $type; |
|
| 436 | + $line .= ($type === '') ? '' : ' <info>Config</info>: '.$type; |
|
| 438 | 437 | } |
| 439 | 438 | } else { |
| 440 | 439 | if ($lineNumber === 1 && !is_null($circle)) { |
| 441 | - $line .= '<info>' . $circle->getSingleId() . '</info>'; |
|
| 440 | + $line .= '<info>'.$circle->getSingleId().'</info>'; |
|
| 442 | 441 | if (!$this->configService->isLocalInstance($circle->getInstance())) { |
| 443 | - $line .= '@' . $circle->getInstance(); |
|
| 442 | + $line .= '@'.$circle->getInstance(); |
|
| 444 | 443 | } |
| 445 | 444 | } |
| 446 | 445 | } |
| 447 | 446 | |
| 448 | 447 | return $line; |
| 449 | - } catch (InvalidItemException|ItemNotFoundException|UnknownTypeException $e) { |
|
| 448 | + } catch (InvalidItemException | ItemNotFoundException | UnknownTypeException $e) { |
|
| 450 | 449 | } |
| 451 | 450 | |
| 452 | 451 | return ''; |