@@ -97,7 +97,7 @@ |
||
97 | 97 | $singleIds = array_merge( |
98 | 98 | [$circle->getSingleId()], |
99 | 99 | array_map( |
100 | - function (Membership $membership) { |
|
100 | + function(Membership $membership) { |
|
101 | 101 | return $membership->getCircleId(); |
102 | 102 | }, $circle->getMemberships() |
103 | 103 | ) |
@@ -54,9 +54,9 @@ |
||
54 | 54 | |
55 | 55 | public static $DELAY = |
56 | 56 | [ |
57 | - 1 => 60, // every minute |
|
58 | - 2 => 300, // every 5 minutes |
|
59 | - 3 => 3600, // every hour |
|
57 | + 1 => 60, // every minute |
|
58 | + 2 => 300, // every 5 minutes |
|
59 | + 3 => 3600, // every hour |
|
60 | 60 | 4 => 75400, // every day |
61 | 61 | 5 => 432000 // evey week |
62 | 62 | ]; |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | return $mountPoint; |
153 | 153 | } |
154 | 154 | |
155 | - return '/' . $userId . '/files/' . ltrim($mountPoint, '/'); |
|
155 | + return '/'.$userId.'/files/'.ltrim($mountPoint, '/'); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | /** |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | public function toMount(string $userId, string $protocol = 'https'): array { |
292 | 292 | return [ |
293 | 293 | 'owner' => $this->getOwner(), |
294 | - 'remote' => $protocol . '://' . $this->getInstance(), |
|
294 | + 'remote' => $protocol.'://'.$this->getInstance(), |
|
295 | 295 | 'token' => $this->getToken(), |
296 | 296 | 'share_token' => $this->getToken(), |
297 | 297 | 'password' => $this->getPassword(), |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | //use OCA\Files\App as FilesApp; |
83 | 83 | |
84 | 84 | |
85 | -require_once __DIR__ . '/../../vendor/autoload.php'; |
|
85 | +require_once __DIR__.'/../../vendor/autoload.php'; |
|
86 | 86 | |
87 | 87 | |
88 | 88 | /** |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | // It seems that AccountManager use deprecated dispatcher, let's use a deprecated listener |
147 | 147 | $dispatcher = OC::$server->getEventDispatcher(); |
148 | 148 | $dispatcher->addListener( |
149 | - 'OC\AccountManager::userUpdated', function (GenericEvent $event) { |
|
149 | + 'OC\AccountManager::userUpdated', function(GenericEvent $event) { |
|
150 | 150 | /** @var IUser $user */ |
151 | 151 | $user = $event->getSubject(); |
152 | 152 | /** @var DeprecatedListener $deprecatedListener */ |
@@ -252,8 +252,8 @@ discard block |
||
252 | 252 | $qb->filterDirectMembership(CoreQueryBuilder::MEMBER, $probe->getFilterMember()); |
253 | 253 | } |
254 | 254 | |
255 | - $qb->orderBy($qb->getDefaultSelectAlias() . '.level', 'desc'); |
|
256 | - $qb->addOrderBy($qb->getDefaultSelectAlias() . '.cached_name', 'asc'); |
|
255 | + $qb->orderBy($qb->getDefaultSelectAlias().'.level', 'desc'); |
|
256 | + $qb->addOrderBy($qb->getDefaultSelectAlias().'.cached_name', 'asc'); |
|
257 | 257 | |
258 | 258 | return $this->getItemsFromRequest($qb); |
259 | 259 | } |
@@ -278,8 +278,8 @@ discard block |
||
278 | 278 | $qb->limitToMembersByInheritance(CoreQueryBuilder::MEMBER, $singleId, $level); |
279 | 279 | |
280 | 280 | $aliasMembership = $qb->generateAlias(CoreQueryBuilder::MEMBER, CoreQueryBuilder::MEMBERSHIPS); |
281 | - $qb->orderBy($aliasMembership . '.inheritance_depth', 'asc') |
|
282 | - ->addGroupBy($aliasMembership . '.inheritance_depth'); |
|
281 | + $qb->orderBy($aliasMembership.'.inheritance_depth', 'asc') |
|
282 | + ->addGroupBy($aliasMembership.'.inheritance_depth'); |
|
283 | 283 | |
284 | 284 | return $this->getItemsFromRequest($qb); |
285 | 285 | } |
@@ -338,10 +338,10 @@ discard block |
||
338 | 338 | $qb = $this->getMemberSelectSql(); |
339 | 339 | $qb->limitToCircleId($circleId); |
340 | 340 | |
341 | - $qb->andwhere($qb->expr()->nonEmptyString(CoreQueryBuilder::MEMBER . '.instance')); |
|
341 | + $qb->andwhere($qb->expr()->nonEmptyString(CoreQueryBuilder::MEMBER.'.instance')); |
|
342 | 342 | |
343 | 343 | return array_map( |
344 | - function (Member $member): string { |
|
344 | + function(Member $member): string { |
|
345 | 345 | return $member->getInstance(); |
346 | 346 | }, $this->getItemsFromRequest($qb) |
347 | 347 | ); |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | */ |
392 | 392 | public function searchFederatedUsers(string $needle): array { |
393 | 393 | $qb = $this->getMemberSelectSql(); |
394 | - $qb->searchInDBField('user_id', '%' . $needle . '%'); |
|
394 | + $qb->searchInDBField('user_id', '%'.$needle.'%'); |
|
395 | 395 | |
396 | 396 | return $this->getItemsFromRequest($qb, true); |
397 | 397 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | $this->federatedUserService->bypassCurrentUserCondition(true); |
150 | 150 | |
151 | 151 | $this->lockMaintenanceRun(); |
152 | - $this->debug('running maintenance (' . $level . ')'); |
|
152 | + $this->debug('running maintenance ('.$level.')'); |
|
153 | 153 | |
154 | 154 | switch ($level) { |
155 | 155 | case 1: |
@@ -308,14 +308,14 @@ discard block |
||
308 | 308 | ->includeSystemCircles(); |
309 | 309 | |
310 | 310 | $circles = array_map( |
311 | - function (Circle $circle) { |
|
311 | + function(Circle $circle) { |
|
312 | 312 | return $circle->getSingleId(); |
313 | 313 | }, $this->circleRequest->getCircles(null, $probe) |
314 | 314 | ); |
315 | 315 | |
316 | 316 | $shares = array_unique( |
317 | 317 | array_map( |
318 | - function (ShareWrapper $share) { |
|
318 | + function(ShareWrapper $share) { |
|
319 | 319 | return $share->getSharedWith(); |
320 | 320 | }, $this->shareWrapperRequest->getShares() |
321 | 321 | ) |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | */ |
361 | 361 | private function output(string $message): void { |
362 | 362 | if (!is_null($this->output)) { |
363 | - $this->output->writeln('- ' . $message); |
|
363 | + $this->output->writeln('- '.$message); |
|
364 | 364 | } |
365 | 365 | } |
366 | 366 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | |
204 | 204 | // get the singleId of a Group |
205 | 205 | $federatedUser = $circlesManager->getFederatedUser('testGroup', Member::TYPE_GROUP); |
206 | - echo 'singleId: ' . $federatedUser->getSingleId() . "\n"; |
|
206 | + echo 'singleId: '.$federatedUser->getSingleId()."\n"; |
|
207 | 207 | |
208 | 208 | // $federatedUser->getMemberships(); |
209 | 209 | |
@@ -242,8 +242,8 @@ discard block |
||
242 | 242 | |
243 | 243 | |
244 | 244 | $members = array_map( |
245 | - function (Member $member): string { |
|
246 | - return $member->getUserId() . ' ' . $member->getSingleId() . ' - ' . $member->getUserType(); |
|
245 | + function(Member $member): string { |
|
246 | + return $member->getUserId().' '.$member->getSingleId().' - '.$member->getUserType(); |
|
247 | 247 | }, $circle->getInheritedMembers() |
248 | 248 | ); |
249 | 249 | |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | } catch (Exception $e) { |
330 | 330 | if ($this->pOn) { |
331 | 331 | $message = ($e->getMessage() !== '') ? $e->getMessage() : get_class($e); |
332 | - $this->output->writeln('<error>' . $message . '</error>'); |
|
332 | + $this->output->writeln('<error>'.$message.'</error>'); |
|
333 | 333 | } else { |
334 | 334 | throw $e; |
335 | 335 | } |
@@ -413,7 +413,7 @@ discard block |
||
413 | 413 | */ |
414 | 414 | private function loadConfiguration() { |
415 | 415 | $this->p('Loading configuration'); |
416 | - $configuration = file_get_contents(__DIR__ . '/../../testConfiguration.json'); |
|
416 | + $configuration = file_get_contents(__DIR__.'/../../testConfiguration.json'); |
|
417 | 417 | $this->config = json_decode($configuration, true); |
418 | 418 | $this->r(true, 'testConfiguration.json'); |
419 | 419 | |
@@ -446,22 +446,22 @@ discard block |
||
446 | 446 | $this->r(); |
447 | 447 | |
448 | 448 | foreach ($this->getInstances() as $instance) { |
449 | - $this->p('Creating users on ' . $instance); |
|
449 | + $this->p('Creating users on '.$instance); |
|
450 | 450 | foreach ($this->getConfigArray($instance, 'users') as $userId) { |
451 | 451 | $this->pm($userId); |
452 | 452 | $this->occ( |
453 | - $instance, 'user:add --password-from-env ' . $userId, false, false, |
|
453 | + $instance, 'user:add --password-from-env '.$userId, false, false, |
|
454 | 454 | ['OC_PASS' => 'testtest'] |
455 | 455 | ); |
456 | 456 | } |
457 | 457 | $this->r(); |
458 | 458 | |
459 | 459 | foreach ($this->getConfigArray($instance, 'groups') as $groupId => $users) { |
460 | - $this->p('Creating group <info>' . $groupId . '</info> on <info>' . $instance . '</info>'); |
|
461 | - $this->occ($instance, 'group:add ' . $groupId, false, false); |
|
460 | + $this->p('Creating group <info>'.$groupId.'</info> on <info>'.$instance.'</info>'); |
|
461 | + $this->occ($instance, 'group:add '.$groupId, false, false); |
|
462 | 462 | foreach ($users as $userId) { |
463 | 463 | $this->pm($userId); |
464 | - $this->occ($instance, 'group:adduser ' . $groupId . ' ' . $userId, true, false); |
|
464 | + $this->occ($instance, 'group:adduser '.$groupId.' '.$userId, true, false); |
|
465 | 465 | } |
466 | 466 | $this->r(); |
467 | 467 | } |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | foreach ($this->getInstances(true) as $instance) { |
496 | 496 | $this->pm($instance); |
497 | 497 | foreach ($this->getConfigArray($instance, 'config') as $k => $v) { |
498 | - $this->occ($instance, 'config:app:set --value ' . $v . ' circles ' . $k, true, false); |
|
498 | + $this->occ($instance, 'config:app:set --value '.$v.' circles '.$k, true, false); |
|
499 | 499 | } |
500 | 500 | } |
501 | 501 | $this->r(); |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | */ |
509 | 509 | private function confirmVersion() { |
510 | 510 | $version = $this->configService->getAppValue('installed_version'); |
511 | - $this->p('Confirming version <info>' . $version . '</info>'); |
|
511 | + $this->p('Confirming version <info>'.$version.'</info>'); |
|
512 | 512 | foreach ($this->getInstances(false) as $instance) { |
513 | 513 | $this->pm($instance); |
514 | 514 | $capabilities = $this->occ($instance, 'circles:check --capabilities'); |
@@ -559,12 +559,12 @@ discard block |
||
559 | 559 | */ |
560 | 560 | private function statusFreshInstances() { |
561 | 561 | foreach ($this->getInstances() as $instanceId) { |
562 | - $this->p('Circles on ' . $instanceId); |
|
562 | + $this->p('Circles on '.$instanceId); |
|
563 | 563 | $result = $this->occ($instanceId, 'circles:manage:list --all'); |
564 | 564 | $expectedSize = sizeof($this->getConfigArray($instanceId, 'groups')) |
565 | 565 | + sizeof($this->getConfigArray($instanceId, 'users')) |
566 | 566 | + 1; |
567 | - $this->r((sizeof($result) === $expectedSize), sizeof($result) . ' circles'); |
|
567 | + $this->r((sizeof($result) === $expectedSize), sizeof($result).' circles'); |
|
568 | 568 | |
569 | 569 | $membersList = $groupsList = []; |
570 | 570 | foreach ($result as $item) { |
@@ -583,12 +583,12 @@ discard block |
||
583 | 583 | $instance = $this->getConfig($instanceId, 'config.frontal_cloud_id'); |
584 | 584 | |
585 | 585 | foreach ($this->getConfigArray($instanceId, 'users') as $userId) { |
586 | - $this->p('Checking Single Circle for <comment>' . $userId . '@' . $instance . '</comment>'); |
|
586 | + $this->p('Checking Single Circle for <comment>'.$userId.'@'.$instance.'</comment>'); |
|
587 | 587 | $circle = $this->getSingleCircleForMember($membersList, $userId, $instance); |
588 | 588 | |
589 | 589 | $compareToOwnerBasedOn = new Circle(); |
590 | 590 | $compareToOwnerBasedOn->setConfig(Circle::CFG_SINGLE) |
591 | - ->setName('user:' . $userId . ':{CIRCLEID}') |
|
591 | + ->setName('user:'.$userId.':{CIRCLEID}') |
|
592 | 592 | ->setDisplayName($userId); |
593 | 593 | |
594 | 594 | $compareToOwner = new Member(); |
@@ -606,7 +606,7 @@ discard block |
||
606 | 606 | $compareTo = new Circle(); |
607 | 607 | $compareTo->setOwner($compareToOwner) |
608 | 608 | ->setConfig(Circle::CFG_SINGLE) |
609 | - ->setName('user:' . $userId . ':{CIRCLEID}') |
|
609 | + ->setName('user:'.$userId.':{CIRCLEID}') |
|
610 | 610 | ->setDisplayName($userId); |
611 | 611 | |
612 | 612 | $this->confirmCircleData($circle, $compareTo); |
@@ -643,8 +643,8 @@ discard block |
||
643 | 643 | $this->r(true, $circle->getSingleId()); |
644 | 644 | |
645 | 645 | foreach ($this->getConfigArray($instanceId, 'groups') as $groupId => $members) { |
646 | - $this->p('Checking Circle for <comment>' . $groupId . '@' . $instance . '</comment>'); |
|
647 | - $circle = $this->getCircleFromList($groupsList, 'group:' . $groupId); |
|
646 | + $this->p('Checking Circle for <comment>'.$groupId.'@'.$instance.'</comment>'); |
|
647 | + $circle = $this->getCircleFromList($groupsList, 'group:'.$groupId); |
|
648 | 648 | |
649 | 649 | $appCircle = $this->getSingleCircleForMember($membersList, 'circles', $instance); |
650 | 650 | $appOwner = $appCircle->getOwner(); |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | $compareTo = new Circle(); |
669 | 669 | $compareTo->setOwner($compareToOwner) |
670 | 670 | ->setConfig(Circle::CFG_SYSTEM | Circle::CFG_NO_OWNER | Circle::CFG_HIDDEN) |
671 | - ->setName('group:' . $groupId) |
|
671 | + ->setName('group:'.$groupId) |
|
672 | 672 | ->setDisplayName($groupId); |
673 | 673 | |
674 | 674 | $this->confirmCircleData($circle, $compareTo); |
@@ -685,12 +685,12 @@ discard block |
||
685 | 685 | */ |
686 | 686 | private function createRemoteLink() { |
687 | 687 | foreach ($this->getInstances() as $instanceId) { |
688 | - $this->p('Init remote link from ' . $instanceId); |
|
688 | + $this->p('Init remote link from '.$instanceId); |
|
689 | 689 | $links = $this->getConfigArray($instanceId, 'remote'); |
690 | 690 | foreach ($links as $link => $type) { |
691 | 691 | $remote = $this->getConfig($link, 'config.frontal_cloud_id'); |
692 | - $this->pm($remote . '(' . $type . ')'); |
|
693 | - $this->occ($instanceId, 'circles:remote ' . $remote . ' --type ' . $type . ' --yes'); |
|
692 | + $this->pm($remote.'('.$type.')'); |
|
693 | + $this->occ($instanceId, 'circles:remote '.$remote.' --type '.$type.' --yes'); |
|
694 | 694 | } |
695 | 695 | $this->r(); |
696 | 696 | } |
@@ -704,7 +704,7 @@ discard block |
||
704 | 704 | private function buildingLocalDatabase() { |
705 | 705 | $this->circles = $this->federatedUsers = []; |
706 | 706 | foreach ($this->getInstances() as $instanceId) { |
707 | - $this->p('Retrieving Circles from ' . $instanceId); |
|
707 | + $this->p('Retrieving Circles from '.$instanceId); |
|
708 | 708 | $circles = $this->occ($instanceId, 'circles:manage:list --all'); |
709 | 709 | foreach ($circles as $item) { |
710 | 710 | /** @var Circle $circle */ |
@@ -739,7 +739,7 @@ discard block |
||
739 | 739 | $name = self::$TEST_CIRCLES[0]; |
740 | 740 | $owner = $this->getInstanceUsers($localInstanceId)[1]; |
741 | 741 | $dataCreatedCircle001 = |
742 | - $this->occ($localInstanceId, 'circles:manage:create --type user ' . $owner . ' ' . $name); |
|
742 | + $this->occ($localInstanceId, 'circles:manage:create --type user '.$owner.' '.$name); |
|
743 | 743 | /** @var Circle $createdCircle */ |
744 | 744 | $createdCircle = $this->deserialize($dataCreatedCircle001, Circle::class); |
745 | 745 | $this->circles[$localInstanceId][$createdCircle->getName()] = $createdCircle; |
@@ -771,7 +771,7 @@ discard block |
||
771 | 771 | |
772 | 772 | |
773 | 773 | $this->p('Comparing local stored data'); |
774 | - $dataCircle = $this->occ($localInstanceId, 'circle:manage:details ' . $createdCircle->getSingleId()); |
|
774 | + $dataCircle = $this->occ($localInstanceId, 'circle:manage:details '.$createdCircle->getSingleId()); |
|
775 | 775 | |
776 | 776 | /** @var Circle $tmpCircle */ |
777 | 777 | $tmpCircle = $this->deserialize($dataCircle, Circle::class); |
@@ -780,9 +780,9 @@ discard block |
||
780 | 780 | |
781 | 781 | $links = $this->getConfigArray('global-scale-1', 'remote'); |
782 | 782 | foreach ($this->getInstances(false) as $instanceId) { |
783 | - $this->p('Comparing data stored on ' . $instanceId); |
|
783 | + $this->p('Comparing data stored on '.$instanceId); |
|
784 | 784 | $dataCircle = |
785 | - $this->occ($instanceId, 'circle:manage:details ' . $createdCircle->getSingleId(), false); |
|
785 | + $this->occ($instanceId, 'circle:manage:details '.$createdCircle->getSingleId(), false); |
|
786 | 786 | |
787 | 787 | if ($instanceId === $localInstanceId || $links[$instanceId] === 'GlobalScale') { |
788 | 788 | /** @var Circle $tmpCircle */ |
@@ -835,11 +835,11 @@ discard block |
||
835 | 835 | $name = self::$TEST_CIRCLES[0]; |
836 | 836 | $circle = $this->getCircleByName($localInstanceId, $name); |
837 | 837 | $userId = $this->getInstanceUsers($localInstanceId)[6]; |
838 | - $userCircle = $this->getCircleByName($localInstanceId, 'user:' . $userId); |
|
838 | + $userCircle = $this->getCircleByName($localInstanceId, 'user:'.$userId); |
|
839 | 839 | $user = $userCircle->getOwner(); |
840 | 840 | $dataAddedMember = |
841 | 841 | $this->occ( |
842 | - $localInstanceId, 'circles:members:add ' . $circle->getSingleId() . ' ' . $user->getSingleId() |
|
842 | + $localInstanceId, 'circles:members:add '.$circle->getSingleId().' '.$user->getSingleId() |
|
843 | 843 | ); |
844 | 844 | /** @var Member $addedMember */ |
845 | 845 | $addedMember = $this->deserialize($dataAddedMember, Member::class); |
@@ -859,11 +859,11 @@ discard block |
||
859 | 859 | |
860 | 860 | $circle = $this->getCircleByName($localInstanceId, $circleName); |
861 | 861 | $userId = $this->getInstanceUsers($localInstanceId)[6]; |
862 | - $userCircle = $this->getCircleByName($localInstanceId, 'user:' . $userId); |
|
862 | + $userCircle = $this->getCircleByName($localInstanceId, 'user:'.$userId); |
|
863 | 863 | $user = $userCircle->getOwner(); |
864 | 864 | $dataAddedMember = |
865 | 865 | $this->occ( |
866 | - $localInstanceId, 'circles:members:add ' . $circle->getSingleId() . ' ' . $user->getSingleId() |
|
866 | + $localInstanceId, 'circles:members:add '.$circle->getSingleId().' '.$user->getSingleId() |
|
867 | 867 | ); |
868 | 868 | /** @var Member $addedMember */ |
869 | 869 | $addedMember = $this->deserialize($dataAddedMember, Member::class); |
@@ -957,13 +957,13 @@ discard block |
||
957 | 957 | ]; |
958 | 958 | } |
959 | 959 | |
960 | - $this->compare($compareTo->getSingleId(), $circle->getSingleId(), $prefix . '.id', $params); |
|
961 | - $this->compare($compareTo->getName(), $circle->getName(), $prefix . '.name', $params); |
|
960 | + $this->compare($compareTo->getSingleId(), $circle->getSingleId(), $prefix.'.id', $params); |
|
961 | + $this->compare($compareTo->getName(), $circle->getName(), $prefix.'.name', $params); |
|
962 | 962 | $this->compare( |
963 | - $compareTo->getDisplayName(), $circle->getDisplayName(), $prefix . '.displayName', $params |
|
963 | + $compareTo->getDisplayName(), $circle->getDisplayName(), $prefix.'.displayName', $params |
|
964 | 964 | ); |
965 | - $this->compareInt($compareTo->getConfig(), $circle->getConfig(), $prefix . '.config', true); |
|
966 | - $this->compareInt($compareTo->getSource(), $circle->getSource(), $prefix . '.source'); |
|
965 | + $this->compareInt($compareTo->getConfig(), $circle->getConfig(), $prefix.'.config', true); |
|
966 | + $this->compareInt($compareTo->getSource(), $circle->getSource(), $prefix.'.source'); |
|
967 | 967 | |
968 | 968 | if ($compareTo->hasOwner()) { |
969 | 969 | $compareToOwner = $compareTo->getOwner(); |
@@ -973,7 +973,7 @@ discard block |
||
973 | 973 | throw new Exception('empty owner'); |
974 | 974 | } |
975 | 975 | if ($owner->getCircleId() !== $circle->getSingleId()) { |
976 | - throw new Exception($prefix . '.owner.circleId is different than ' . $prefix . '.id'); |
|
976 | + throw new Exception($prefix.'.owner.circleId is different than '.$prefix.'.id'); |
|
977 | 977 | } |
978 | 978 | $this->confirmMemberData($owner, $compareToOwner, 'owner', false, $params); |
979 | 979 | } |
@@ -986,7 +986,7 @@ discard block |
||
986 | 986 | } |
987 | 987 | $initiator = $circle->getInitiator(); |
988 | 988 | if ($initiator->getCircleId() !== $circle->getSingleId()) { |
989 | - throw new Exception($prefix . '.initiator.circleId is different than ' . $prefix . '.id'); |
|
989 | + throw new Exception($prefix.'.initiator.circleId is different than '.$prefix.'.id'); |
|
990 | 990 | } |
991 | 991 | $this->confirmMemberData($initiator, $compareToInitiator, 'owner', false, $params); |
992 | 992 | } |
@@ -1013,27 +1013,27 @@ discard block |
||
1013 | 1013 | bool $versa = false, |
1014 | 1014 | array $params = [] |
1015 | 1015 | ) { |
1016 | - $this->compare($compareTo->getId(), $member->getId(), $prefix . '.id', $params); |
|
1017 | - $this->compare($compareTo->getCircleId(), $member->getCircleId(), $prefix . '.circleId', $params); |
|
1018 | - $this->compare($compareTo->getSingleId(), $member->getSingleId(), $prefix . '.singleId', $params); |
|
1019 | - $this->compare($compareTo->getUserId(), $member->getUserId(), $prefix . '.userId', $params); |
|
1016 | + $this->compare($compareTo->getId(), $member->getId(), $prefix.'.id', $params); |
|
1017 | + $this->compare($compareTo->getCircleId(), $member->getCircleId(), $prefix.'.circleId', $params); |
|
1018 | + $this->compare($compareTo->getSingleId(), $member->getSingleId(), $prefix.'.singleId', $params); |
|
1019 | + $this->compare($compareTo->getUserId(), $member->getUserId(), $prefix.'.userId', $params); |
|
1020 | 1020 | $this->compare( |
1021 | - $compareTo->getDisplayName(), $member->getDisplayName(), $prefix . '.displayName', $params |
|
1021 | + $compareTo->getDisplayName(), $member->getDisplayName(), $prefix.'.displayName', $params |
|
1022 | 1022 | ); |
1023 | - $this->compareInt($compareTo->getUserType(), $member->getUserType(), $prefix . '.userType'); |
|
1024 | - $this->compare($compareTo->getInstance(), $member->getInstance(), $prefix . '.instance', $params); |
|
1025 | - $this->compareInt($compareTo->getLevel(), $member->getLevel(), $prefix . '.level', true); |
|
1026 | - $this->compare($compareTo->getStatus(), $member->getStatus(), $prefix . '.status', $params); |
|
1023 | + $this->compareInt($compareTo->getUserType(), $member->getUserType(), $prefix.'.userType'); |
|
1024 | + $this->compare($compareTo->getInstance(), $member->getInstance(), $prefix.'.instance', $params); |
|
1025 | + $this->compareInt($compareTo->getLevel(), $member->getLevel(), $prefix.'.level', true); |
|
1026 | + $this->compare($compareTo->getStatus(), $member->getStatus(), $prefix.'.status', $params); |
|
1027 | 1027 | |
1028 | 1028 | if ($compareTo->hasBasedOn()) { |
1029 | 1029 | if (!$member->hasBasedOn()) { |
1030 | - throw new Exception('empty ' . $prefix . '.basedOn'); |
|
1030 | + throw new Exception('empty '.$prefix.'.basedOn'); |
|
1031 | 1031 | } |
1032 | 1032 | $basedOn = $member->getBasedOn(); |
1033 | 1033 | $this->confirmCircleData( |
1034 | 1034 | $basedOn, |
1035 | 1035 | $compareTo->getBasedOn(), |
1036 | - $prefix . '.basedOn', |
|
1036 | + $prefix.'.basedOn', |
|
1037 | 1037 | false, |
1038 | 1038 | $params |
1039 | 1039 | ); |
@@ -1052,7 +1052,7 @@ discard block |
||
1052 | 1052 | private function compare(string $expected, string $compare, string $def, array $params) { |
1053 | 1053 | if ($expected !== '' |
1054 | 1054 | && $this->feedStringWithParams($expected, $params) !== $compare) { |
1055 | - throw new Exception($def . ': ' . $compare . ' (' . $expected . ')'); |
|
1055 | + throw new Exception($def.': '.$compare.' ('.$expected.')'); |
|
1056 | 1056 | } |
1057 | 1057 | } |
1058 | 1058 | |
@@ -1068,7 +1068,7 @@ discard block |
||
1068 | 1068 | private function compareInt(int $expected, int $compare, string $def, bool $force = false) { |
1069 | 1069 | if (($expected > 0 || ($force && $expected >= 0)) |
1070 | 1070 | && $expected !== $compare) { |
1071 | - throw new Exception('wrong ' . $def . ': ' . $compare . ' (' . $expected . ')'); |
|
1071 | + throw new Exception('wrong '.$def.': '.$compare.' ('.$expected.')'); |
|
1072 | 1072 | } |
1073 | 1073 | } |
1074 | 1074 | |
@@ -1104,7 +1104,7 @@ discard block |
||
1104 | 1104 | } |
1105 | 1105 | } |
1106 | 1106 | |
1107 | - throw new CircleNotFoundException('cannot find ' . $userId . ' in the list of Single Circle'); |
|
1107 | + throw new CircleNotFoundException('cannot find '.$userId.' in the list of Single Circle'); |
|
1108 | 1108 | } |
1109 | 1109 | |
1110 | 1110 | |
@@ -1122,7 +1122,7 @@ discard block |
||
1122 | 1122 | } |
1123 | 1123 | |
1124 | 1124 | throw new CircleNotFoundException( |
1125 | - 'cannot extract \'' . $name . '\' from the list of generated Circles' |
|
1125 | + 'cannot extract \''.$name.'\' from the list of generated Circles' |
|
1126 | 1126 | ); |
1127 | 1127 | } |
1128 | 1128 | |
@@ -1142,7 +1142,7 @@ discard block |
||
1142 | 1142 | } |
1143 | 1143 | |
1144 | 1144 | throw new CircleNotFoundException( |
1145 | - 'cannot extract \'' . $name . '\' from the list of provided Circles' |
|
1145 | + 'cannot extract \''.$name.'\' from the list of provided Circles' |
|
1146 | 1146 | ); |
1147 | 1147 | } |
1148 | 1148 | |
@@ -1187,7 +1187,7 @@ discard block |
||
1187 | 1187 | } |
1188 | 1188 | } |
1189 | 1189 | |
1190 | - throw new ItemNotFoundException($instance . ' not found'); |
|
1190 | + throw new ItemNotFoundException($instance.' not found'); |
|
1191 | 1191 | } |
1192 | 1192 | |
1193 | 1193 | |
@@ -1222,7 +1222,7 @@ discard block |
||
1222 | 1222 | ): ?array { |
1223 | 1223 | $configInstance = $this->getConfigInstance($instance); |
1224 | 1224 | $path = $this->get('path', $configInstance); |
1225 | - $occ = rtrim($path, '/') . '/occ'; |
|
1225 | + $occ = rtrim($path, '/').'/occ'; |
|
1226 | 1226 | |
1227 | 1227 | $command = array_merge([$occ], explode(' ', $cmd)); |
1228 | 1228 | if ($jsonAsOutput) { |
@@ -1232,7 +1232,7 @@ discard block |
||
1232 | 1232 | $process->run(null, $env); |
1233 | 1233 | |
1234 | 1234 | if ($exceptionOnFail && !$process->isSuccessful()) { |
1235 | - throw new Exception(implode(' ', $command) . ' failed'); |
|
1235 | + throw new Exception(implode(' ', $command).' failed'); |
|
1236 | 1236 | } |
1237 | 1237 | |
1238 | 1238 | $output = json_decode($process->getOutput(), true); |
@@ -1255,7 +1255,7 @@ discard block |
||
1255 | 1255 | */ |
1256 | 1256 | private function t(string $title): void { |
1257 | 1257 | $this->output->writeln(''); |
1258 | - $this->output->writeln('<comment>### ' . $title . '</comment>'); |
|
1258 | + $this->output->writeln('<comment>### '.$title.'</comment>'); |
|
1259 | 1259 | $this->output->writeln(''); |
1260 | 1260 | } |
1261 | 1261 | |
@@ -1264,14 +1264,14 @@ discard block |
||
1264 | 1264 | */ |
1265 | 1265 | private function p(string $processing): void { |
1266 | 1266 | $this->pOn = true; |
1267 | - $this->output->write('- ' . $processing . ': '); |
|
1267 | + $this->output->write('- '.$processing.': '); |
|
1268 | 1268 | } |
1269 | 1269 | |
1270 | 1270 | /** |
1271 | 1271 | * @param string $more |
1272 | 1272 | */ |
1273 | 1273 | private function pm(string $more): void { |
1274 | - $this->output->write($more . ' '); |
|
1274 | + $this->output->write($more.' '); |
|
1275 | 1275 | } |
1276 | 1276 | |
1277 | 1277 | /** |
@@ -1281,9 +1281,9 @@ discard block |
||
1281 | 1281 | private function r(bool $result = true, string $info = ''): void { |
1282 | 1282 | $this->pOn = false; |
1283 | 1283 | if ($result) { |
1284 | - $this->output->writeln('<info>' . (($info !== '') ? $info : 'done') . '</info>'); |
|
1284 | + $this->output->writeln('<info>'.(($info !== '') ? $info : 'done').'</info>'); |
|
1285 | 1285 | } else { |
1286 | - $this->output->writeln('<error>' . (($info !== '') ? $info : 'done') . '</error>'); |
|
1286 | + $this->output->writeln('<error>'.(($info !== '') ? $info : 'done').'</error>'); |
|
1287 | 1287 | } |
1288 | 1288 | } |
1289 | 1289 | |
@@ -1305,16 +1305,16 @@ discard block |
||
1305 | 1305 | $dataAddedMember = |
1306 | 1306 | $this->occ( |
1307 | 1307 | $instanceId, |
1308 | - 'circles:members:add ' . $circle->getSingleId() . ' ' . $userId . ' --type ' . $type |
|
1308 | + 'circles:members:add '.$circle->getSingleId().' '.$userId.' --type '.$type |
|
1309 | 1309 | ); |
1310 | 1310 | /** @var Member $addedMember */ |
1311 | 1311 | $addedMember = $this->deserialize($dataAddedMember, Member::class); |
1312 | 1312 | |
1313 | 1313 | |
1314 | - echo 'ADDEDMEMBER: ' . json_encode($addedMember, JSON_PRETTY_PRINT) . "\n"; |
|
1314 | + echo 'ADDEDMEMBER: '.json_encode($addedMember, JSON_PRETTY_PRINT)."\n"; |
|
1315 | 1315 | |
1316 | 1316 | $federatedUser = $this->federatedUsers[$instanceId][$userId]; |
1317 | - echo 'FEDERATEDUER: ' . json_encode($federatedUser, JSON_PRETTY_PRINT) . "\n"; |
|
1317 | + echo 'FEDERATEDUER: '.json_encode($federatedUser, JSON_PRETTY_PRINT)."\n"; |
|
1318 | 1318 | |
1319 | 1319 | return $addedMember; |
1320 | 1320 | } |
@@ -409,12 +409,12 @@ discard block |
||
409 | 409 | throw new UnknownInterfaceException('misconfigured scheme'); |
410 | 410 | } |
411 | 411 | |
412 | - $base = $scheme . '://' . $this->getCloudInstance($interface) . $path; |
|
412 | + $base = $scheme.'://'.$this->getCloudInstance($interface).$path; |
|
413 | 413 | if ($route === '') { |
414 | 414 | return $base; |
415 | 415 | } |
416 | 416 | |
417 | - return $base . $this->configService->linkToRoute($route, $args); |
|
417 | + return $base.$this->configService->linkToRoute($route, $args); |
|
418 | 418 | } |
419 | 419 | |
420 | 420 | |
@@ -447,7 +447,7 @@ discard block |
||
447 | 447 | return $this->configService->getLoopbackPath($route, $args); |
448 | 448 | } |
449 | 449 | |
450 | - return rtrim($base, '/') . $this->configService->linkToRoute($route, $args); |
|
450 | + return rtrim($base, '/').$this->configService->linkToRoute($route, $args); |
|
451 | 451 | } |
452 | 452 | |
453 | 453 |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | throw new Exception('Please specify a --type for the test'); |
178 | 178 | } |
179 | 179 | if ($test !== '' && !in_array($type, self::$checks)) { |
180 | - throw new Exception('Unknown type: ' . implode(', ', self::$checks)); |
|
180 | + throw new Exception('Unknown type: '.implode(', ', self::$checks)); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | // $this->configService->setAppValue(ConfigService::TEST_NC_BASE, $test); |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | } |
236 | 236 | |
237 | 237 | $output->writeln(''); |
238 | - $output->writeln('* testing current address: ' . $test); |
|
238 | + $output->writeln('* testing current address: '.$test); |
|
239 | 239 | |
240 | 240 | try { |
241 | 241 | $this->setupLoopback($input, $output, $test); |
@@ -271,8 +271,8 @@ discard block |
||
271 | 271 | continue; |
272 | 272 | } |
273 | 273 | |
274 | - $loopback = rtrim($scheme . '://' . $cloudId . $path, '/'); |
|
275 | - $output->writeln('* testing address: ' . $loopback . ' '); |
|
274 | + $loopback = rtrim($scheme.'://'.$cloudId.$path, '/'); |
|
275 | + $output->writeln('* testing address: '.$loopback.' '); |
|
276 | 276 | |
277 | 277 | try { |
278 | 278 | $this->setupLoopback($input, $output, $loopback); |
@@ -344,7 +344,7 @@ discard block |
||
344 | 344 | $test = new FederatedEvent(LoopbackTest::class); |
345 | 345 | $this->federatedEventService->newEvent($test); |
346 | 346 | |
347 | - $output->writeln('<info>' . $test->getWrapperToken() . '</info>'); |
|
347 | + $output->writeln('<info>'.$test->getWrapperToken().'</info>'); |
|
348 | 348 | |
349 | 349 | $output->writeln('- Waiting for async process to finish (5s)'); |
350 | 350 | sleep(5); |
@@ -359,18 +359,18 @@ discard block |
||
359 | 359 | |
360 | 360 | $checkVerify = $wrapper->getEvent()->getData()->gInt('verify'); |
361 | 361 | if ($checkVerify === LoopbackTest::VERIFY) { |
362 | - $output->write('<info>verify=' . $checkVerify . '</info> '); |
|
362 | + $output->write('<info>verify='.$checkVerify.'</info> '); |
|
363 | 363 | } else { |
364 | - $output->writeln('<error>verify=' . $checkVerify . '</error>'); |
|
364 | + $output->writeln('<error>verify='.$checkVerify.'</error>'); |
|
365 | 365 | |
366 | 366 | return false; |
367 | 367 | } |
368 | 368 | |
369 | 369 | $checkManage = $wrapper->getResult()->gInt('manage'); |
370 | 370 | if ($checkManage === LoopbackTest::MANAGE) { |
371 | - $output->write('<info>manage=' . $checkManage . '</info> '); |
|
371 | + $output->write('<info>manage='.$checkManage.'</info> '); |
|
372 | 372 | } else { |
373 | - $output->writeln('<error>manage=' . $checkManage . '</error>'); |
|
373 | + $output->writeln('<error>manage='.$checkManage.'</error>'); |
|
374 | 374 | |
375 | 375 | return false; |
376 | 376 | } |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | [$scheme, $cloudId, $path] = $this->parseAddress($loopback); |
393 | 393 | |
394 | 394 | $question = new ConfirmationQuestion( |
395 | - '- Do you want to save <info>' . $loopback |
|
395 | + '- Do you want to save <info>'.$loopback |
|
396 | 396 | . '</info> as your <info>loopback</info> address ? (y/N) ', false, '/^(y|Y)/i' |
397 | 397 | ); |
398 | 398 | |
@@ -407,7 +407,7 @@ discard block |
||
407 | 407 | $this->configService->setAppValue(ConfigService::LOOPBACK_CLOUD_ID, $cloudId); |
408 | 408 | $this->configService->setAppValue(ConfigService::LOOPBACK_CLOUD_PATH, $path); |
409 | 409 | $output->writeln( |
410 | - '- Address <info>' . $loopback . '</info> is now used as <info>loopback</info>' |
|
410 | + '- Address <info>'.$loopback.'</info> is now used as <info>loopback</info>' |
|
411 | 411 | ); |
412 | 412 | } |
413 | 413 | |
@@ -459,8 +459,8 @@ discard block |
||
459 | 459 | continue; |
460 | 460 | } |
461 | 461 | |
462 | - $internal = rtrim($scheme . '://' . $cloudId, '/'); |
|
463 | - $fullInternal = rtrim($scheme . '://' . $cloudId . $path, '/'); |
|
462 | + $internal = rtrim($scheme.'://'.$cloudId, '/'); |
|
463 | + $fullInternal = rtrim($scheme.'://'.$cloudId.$path, '/'); |
|
464 | 464 | |
465 | 465 | $question = new ConfirmationQuestion( |
466 | 466 | '<comment>Do you want to check the validity of this internal address?</comment> (Y/n) ', true, |
@@ -479,9 +479,9 @@ discard block |
||
479 | 479 | 'You will need to run this <info>curl</info> command from a terminal on your local network and paste its result: ' |
480 | 480 | ); |
481 | 481 | $output->writeln( |
482 | - ' curl -L "' . $internal |
|
482 | + ' curl -L "'.$internal |
|
483 | 483 | . '/.well-known/webfinger?resource=http://nextcloud.com/&test=' |
484 | - . $testToken . '"' |
|
484 | + . $testToken.'"' |
|
485 | 485 | ); |
486 | 486 | |
487 | 487 | $output->writeln('paste the result here: '); |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | |
516 | 516 | if ($pastedHref !== $href) { |
517 | 517 | $output->writeln( |
518 | - '<error>The returned data (' . $pastedHref . ') are not the one expected: </error>' |
|
518 | + '<error>The returned data ('.$pastedHref.') are not the one expected: </error>' |
|
519 | 519 | . $href |
520 | 520 | ); |
521 | 521 | continue; |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | 'Now, please run this <info>curl</info> command from a terminal on your local network and paste its result: ' |
528 | 528 | ); |
529 | 529 | $output->writeln( |
530 | - ' curl -L "' . $pastedHref . '?test=' . $testToken . '" -H "Accept: application/json"' |
|
530 | + ' curl -L "'.$pastedHref.'?test='.$testToken.'" -H "Accept: application/json"' |
|
531 | 531 | ); |
532 | 532 | |
533 | 533 | $output->writeln('paste the result here: '); |
@@ -544,9 +544,9 @@ discard block |
||
544 | 544 | || $appSignatory->getRoot() !== $pastedSignatory->g('root')) { |
545 | 545 | $output->writeln( |
546 | 546 | '<error>The returned data (' |
547 | - . $pastedSignatory->g('uid') . '/' . $pastedSignatory->g('root') |
|
547 | + . $pastedSignatory->g('uid').'/'.$pastedSignatory->g('root') |
|
548 | 548 | . ') are not the one expected: </error>' |
549 | - . $appSignatory->getUid(true) . '/' . $appSignatory->getRoot() |
|
549 | + . $appSignatory->getUid(true).'/'.$appSignatory->getRoot() |
|
550 | 550 | ); |
551 | 551 | continue; |
552 | 552 | } |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | |
574 | 574 | $output->writeln(''); |
575 | 575 | $question = new ConfirmationQuestion( |
576 | - '- Do you want to save <info>' . $internal |
|
576 | + '- Do you want to save <info>'.$internal |
|
577 | 577 | . '</info> as your <info>internal</info> address ? (y/N) ', false, '/^(y|Y)/i' |
578 | 578 | ); |
579 | 579 | |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | $this->configService->setAppValue(ConfigService::INTERNAL_CLOUD_PATH, $path); |
590 | 590 | |
591 | 591 | $output->writeln( |
592 | - '- Address <info>' . $internal . '</info> is now used as <info>internal</info>' |
|
592 | + '- Address <info>'.$internal.'</info> is now used as <info>internal</info>' |
|
593 | 593 | ); |
594 | 594 | } |
595 | 595 | |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | continue; |
643 | 643 | } |
644 | 644 | |
645 | - $frontal = rtrim($scheme . '://' . $cloudId . $path, '/'); |
|
645 | + $frontal = rtrim($scheme.'://'.$cloudId.$path, '/'); |
|
646 | 646 | break; |
647 | 647 | } |
648 | 648 | |
@@ -656,13 +656,13 @@ discard block |
||
656 | 656 | 'You will need to run this <info>curl</info> command from a remote terminal and paste its result: ' |
657 | 657 | ); |
658 | 658 | $output->writeln( |
659 | - ' curl ' . $frontal . '/.well-known/webfinger?resource=http://nextcloud.com/' |
|
659 | + ' curl '.$frontal.'/.well-known/webfinger?resource=http://nextcloud.com/' |
|
660 | 660 | ); |
661 | 661 | |
662 | 662 | $question = new Question('result: ', ''); |
663 | 663 | $pasteWebfinger = $helper->ask($input, $output, $question); |
664 | 664 | |
665 | - echo '__ ' . $pasteWebfinger; |
|
665 | + echo '__ '.$pasteWebfinger; |
|
666 | 666 | |
667 | 667 | $output->writeln('TESTING !!'); |
668 | 668 | $output->writeln('TESTING !!'); |
@@ -789,7 +789,7 @@ discard block |
||
789 | 789 | $request->setDataSerialize(new SimpleDataStore(['empty' => 1])); |
790 | 790 | } |
791 | 791 | |
792 | - $output->write('- ' . $type . ' request on ' . $request->getCompleteUrl() . ': '); |
|
792 | + $output->write('- '.$type.' request on '.$request->getCompleteUrl().': '); |
|
793 | 793 | |
794 | 794 | try { |
795 | 795 | $this->doRequest($request); |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | $color = 'info'; |
801 | 801 | } |
802 | 802 | |
803 | - $output->writeln('<' . $color . '>' . $result->getStatusCode() . '</' . $color . '>'); |
|
803 | + $output->writeln('<'.$color.'>'.$result->getStatusCode().'</'.$color.'>'); |
|
804 | 804 | if ($result->getStatusCode() === 200) { |
805 | 805 | return true; |
806 | 806 | } |
@@ -824,7 +824,7 @@ discard block |
||
824 | 824 | |
825 | 825 | $output->writeln(''); |
826 | 826 | $output->writeln( |
827 | - 'The address <info>' . $address . '</info> seems to reach your local Nextcloud.' |
|
827 | + 'The address <info>'.$address.'</info> seems to reach your local Nextcloud.' |
|
828 | 828 | ); |
829 | 829 | |
830 | 830 | $helper = $this->getHelper('question'); |
@@ -841,8 +841,8 @@ discard block |
||
841 | 841 | |
842 | 842 | $this->configService->setAppValue(ConfigService::FORCE_NC_BASE, $address); |
843 | 843 | $output->writeln( |
844 | - 'New configuration <info>' . Application::APP_ID . '.' . ConfigService::FORCE_NC_BASE . '=\'' |
|
845 | - . $address . '\'</info> stored in database' |
|
844 | + 'New configuration <info>'.Application::APP_ID.'.'.ConfigService::FORCE_NC_BASE.'=\'' |
|
845 | + . $address.'\'</info> stored in database' |
|
846 | 846 | ); |
847 | 847 | } |
848 | 848 | |
@@ -870,7 +870,7 @@ discard block |
||
870 | 870 | $path = rtrim($path, '/'); |
871 | 871 | |
872 | 872 | if (!is_null($cloudIdPort)) { |
873 | - $cloudId = $cloudId . ':' . $cloudIdPort; |
|
873 | + $cloudId = $cloudId.':'.$cloudIdPort; |
|
874 | 874 | } |
875 | 875 | |
876 | 876 | return [$scheme, $cloudId, $path]; |