@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | return $value; |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | - if (($value = $this->config->getSystemValue(Application::APP_ID . '.' . $key, '')) !== '') { |
|
| 189 | + if (($value = $this->config->getSystemValue(Application::APP_ID.'.'.$key, '')) !== '') { |
|
| 190 | 190 | return $value; |
| 191 | 191 | } |
| 192 | 192 | |
@@ -440,7 +440,7 @@ discard block |
||
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | if (array_key_exists('port', $loopback)) { |
| 443 | - $loopbackCloudId = $loopback['host'] . ':' . $loopback['port']; |
|
| 443 | + $loopbackCloudId = $loopback['host'].':'.$loopback['port']; |
|
| 444 | 444 | } else { |
| 445 | 445 | $loopbackCloudId = $loopback['host']; |
| 446 | 446 | } |
@@ -469,12 +469,12 @@ discard block |
||
| 469 | 469 | $scheme = $this->getAppValue(self::LOOPBACK_CLOUD_SCHEME); |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | - $base = $scheme . '://' . $instance; |
|
| 472 | + $base = $scheme.'://'.$instance; |
|
| 473 | 473 | if ($route === '') { |
| 474 | 474 | return $base; |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | - return $base . $this->urlGenerator->linkToRoute($route, $args); |
|
| 477 | + return $base.$this->urlGenerator->linkToRoute($route, $args); |
|
| 478 | 478 | } |
| 479 | 479 | |
| 480 | 480 | |
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | public function displayFederatedUser(IFederatedUser $federatedUser, bool $displayName = false): string { |
| 575 | 575 | $name = ($displayName) ? $federatedUser->getDisplayName() : $federatedUser->getUserId(); |
| 576 | 576 | |
| 577 | - return $name . $this->displayInstance($federatedUser->getInstance(), true); |
|
| 577 | + return $name.$this->displayInstance($federatedUser->getInstance(), true); |
|
| 578 | 578 | } |
| 579 | 579 | |
| 580 | 580 | /** |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | return ''; |
| 589 | 589 | } |
| 590 | 590 | |
| 591 | - return (($showAt) ? '@' : '') . $instance; |
|
| 591 | + return (($showAt) ? '@' : '').$instance; |
|
| 592 | 592 | } |
| 593 | 593 | |
| 594 | 594 | |
@@ -84,26 +84,26 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | |
| 86 | 86 | // specific value |
| 87 | - const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default. |
|
| 88 | - const CFG_SINGLE = 1; // Circle with only one single member. |
|
| 89 | - const CFG_PERSONAL = 2; // Personal circle, only the owner can see it. |
|
| 87 | + const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default. |
|
| 88 | + const CFG_SINGLE = 1; // Circle with only one single member. |
|
| 89 | + const CFG_PERSONAL = 2; // Personal circle, only the owner can see it. |
|
| 90 | 90 | |
| 91 | 91 | // bitwise |
| 92 | - const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited |
|
| 93 | - const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it |
|
| 94 | - const CFG_OPEN = 16; // Circle is open, people can join |
|
| 95 | - const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted |
|
| 96 | - const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator |
|
| 97 | - const CFG_FRIEND = 128; // Members of the circle can invite their friends |
|
| 98 | - const CFG_PROTECTED = 256; // Password protected to join/request |
|
| 99 | - const CFG_NO_OWNER = 512; // no owner, only members |
|
| 100 | - const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity |
|
| 101 | - const CFG_BACKEND = 2048; // Fully hidden, only backend Circles |
|
| 102 | - const CFG_LOCAL = 4096; // Local even on GlobalScale |
|
| 103 | - const CFG_ROOT = 8192; // Circle cannot be inside another Circle |
|
| 104 | - const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle |
|
| 105 | - const CFG_FEDERATED = 32768; // Federated |
|
| 106 | - const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle |
|
| 92 | + const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited |
|
| 93 | + const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it |
|
| 94 | + const CFG_OPEN = 16; // Circle is open, people can join |
|
| 95 | + const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted |
|
| 96 | + const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator |
|
| 97 | + const CFG_FRIEND = 128; // Members of the circle can invite their friends |
|
| 98 | + const CFG_PROTECTED = 256; // Password protected to join/request |
|
| 99 | + const CFG_NO_OWNER = 512; // no owner, only members |
|
| 100 | + const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity |
|
| 101 | + const CFG_BACKEND = 2048; // Fully hidden, only backend Circles |
|
| 102 | + const CFG_LOCAL = 4096; // Local even on GlobalScale |
|
| 103 | + const CFG_ROOT = 8192; // Circle cannot be inside another Circle |
|
| 104 | + const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle |
|
| 105 | + const CFG_FEDERATED = 32768; // Federated |
|
| 106 | + const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle |
|
| 107 | 107 | |
| 108 | 108 | public static $DEF_CFG_MAX = 131071; |
| 109 | 109 | |
@@ -763,24 +763,24 @@ discard block |
||
| 763 | 763 | * @throws CircleNotFoundException |
| 764 | 764 | */ |
| 765 | 765 | public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow { |
| 766 | - if ($this->get($prefix . 'unique_id', $data) === '') { |
|
| 766 | + if ($this->get($prefix.'unique_id', $data) === '') { |
|
| 767 | 767 | throw new CircleNotFoundException(); |
| 768 | 768 | } |
| 769 | 769 | |
| 770 | - $this->setSingleId($this->get($prefix . 'unique_id', $data)) |
|
| 771 | - ->setName($this->get($prefix . 'name', $data)) |
|
| 772 | - ->setDisplayName($this->get($prefix . 'display_name', $data)) |
|
| 773 | - ->setSanitizedName($this->get($prefix . 'sanitized_name', $data)) |
|
| 774 | - ->setConfig($this->getInt($prefix . 'config', $data)) |
|
| 775 | - ->setSource($this->getInt($prefix . 'source', $data)) |
|
| 776 | - ->setInstance($this->get($prefix . 'instance', $data)) |
|
| 777 | - ->setPopulation($this->getInt($prefix . 'population', $data)) |
|
| 778 | - ->setSettings($this->getArray($prefix . 'settings', $data)) |
|
| 779 | - ->setContactAddressBook($this->getInt($prefix . 'contact_addressbook', $data)) |
|
| 780 | - ->setContactGroupName($this->get($prefix . 'contact_groupname', $data)) |
|
| 781 | - ->setDescription($this->get($prefix . 'description', $data)); |
|
| 782 | - |
|
| 783 | - $creation = $this->get($prefix . 'creation', $data); |
|
| 770 | + $this->setSingleId($this->get($prefix.'unique_id', $data)) |
|
| 771 | + ->setName($this->get($prefix.'name', $data)) |
|
| 772 | + ->setDisplayName($this->get($prefix.'display_name', $data)) |
|
| 773 | + ->setSanitizedName($this->get($prefix.'sanitized_name', $data)) |
|
| 774 | + ->setConfig($this->getInt($prefix.'config', $data)) |
|
| 775 | + ->setSource($this->getInt($prefix.'source', $data)) |
|
| 776 | + ->setInstance($this->get($prefix.'instance', $data)) |
|
| 777 | + ->setPopulation($this->getInt($prefix.'population', $data)) |
|
| 778 | + ->setSettings($this->getArray($prefix.'settings', $data)) |
|
| 779 | + ->setContactAddressBook($this->getInt($prefix.'contact_addressbook', $data)) |
|
| 780 | + ->setContactGroupName($this->get($prefix.'contact_groupname', $data)) |
|
| 781 | + ->setDescription($this->get($prefix.'description', $data)); |
|
| 782 | + |
|
| 783 | + $creation = $this->get($prefix.'creation', $data); |
|
| 784 | 784 | $this->setCreation(DateTime::createFromFormat('Y-m-d H:i:s', $creation)->getTimestamp()); |
| 785 | 785 | |
| 786 | 786 | $this->getManager()->manageImportFromDatabase($this, $data, $prefix); |
@@ -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 | } |
@@ -145,7 +145,7 @@ |
||
| 145 | 145 | |
| 146 | 146 | foreach ($circles as $circle) { |
| 147 | 147 | $this->outputService->output( |
| 148 | - 'Caching memberships for \'' . $circle->getDisplayName() . '\'', |
|
| 148 | + 'Caching memberships for \''.$circle->getDisplayName().'\'', |
|
| 149 | 149 | true |
| 150 | 150 | ); |
| 151 | 151 | $this->manageMemberships($circle->getSingleId()); |
@@ -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 | } |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | '<error>WARNING! You are about to delete all data related to the Circles App!</error>' |
| 119 | 119 | ); |
| 120 | 120 | $question = new ConfirmationQuestion( |
| 121 | - '<comment>Do you really want to ' . $action . ' Circles ?</comment> (y/N) ', false, |
|
| 121 | + '<comment>Do you really want to '.$action.' Circles ?</comment> (y/N) ', false, |
|
| 122 | 122 | '/^(y|Y)/i' |
| 123 | 123 | ); |
| 124 | 124 | |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | $output->writeln('<error>WARNING! This operation is not reversible.</error>'); |
| 134 | 134 | |
| 135 | 135 | $question = new Question( |
| 136 | - '<comment>Please confirm this destructive operation by typing \'' . $action |
|
| 136 | + '<comment>Please confirm this destructive operation by typing \''.$action |
|
| 137 | 137 | . '\'</comment>: ', '' |
| 138 | 138 | ); |
| 139 | 139 | |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $this->coreQueryBuilder->uninstall(); |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | - $output->writeln('<info>' . $action . ' done</info>'); |
|
| 153 | + $output->writeln('<info>'.$action.' done</info>'); |
|
| 154 | 154 | |
| 155 | 155 | return 0; |
| 156 | 156 | } |
@@ -305,18 +305,18 @@ |
||
| 305 | 305 | * @throws MembershipNotFoundException |
| 306 | 306 | */ |
| 307 | 307 | public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow { |
| 308 | - if ($this->get($prefix . 'single_id', $data) === '') { |
|
| 308 | + if ($this->get($prefix.'single_id', $data) === '') { |
|
| 309 | 309 | throw new MembershipNotFoundException(); |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | - $this->setSingleId($this->get($prefix . 'single_id', $data)); |
|
| 313 | - $this->setCircleId($this->get($prefix . 'circle_id', $data)); |
|
| 314 | - $this->setLevel($this->getInt($prefix . 'level', $data)); |
|
| 315 | - $this->setCircleConfig($this->getInt($prefix . 'circle_config', $data)); |
|
| 316 | - $this->setInheritanceFirst($this->get($prefix . 'inheritance_first', $data)); |
|
| 317 | - $this->setInheritanceLast($this->get($prefix . 'inheritance_last', $data)); |
|
| 318 | - $this->setInheritancePath($this->getArray($prefix . 'inheritance_path', $data)); |
|
| 319 | - $this->setInheritanceDepth($this->getInt($prefix . 'inheritance_depth', $data)); |
|
| 312 | + $this->setSingleId($this->get($prefix.'single_id', $data)); |
|
| 313 | + $this->setCircleId($this->get($prefix.'circle_id', $data)); |
|
| 314 | + $this->setLevel($this->getInt($prefix.'level', $data)); |
|
| 315 | + $this->setCircleConfig($this->getInt($prefix.'circle_config', $data)); |
|
| 316 | + $this->setInheritanceFirst($this->get($prefix.'inheritance_first', $data)); |
|
| 317 | + $this->setInheritanceLast($this->get($prefix.'inheritance_last', $data)); |
|
| 318 | + $this->setInheritancePath($this->getArray($prefix.'inheritance_path', $data)); |
|
| 319 | + $this->setInheritanceDepth($this->getInt($prefix.'inheritance_depth', $data)); |
|
| 320 | 320 | |
| 321 | 321 | return $this; |
| 322 | 322 | } |