@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | $l10n = \OCP\Server::get(IFactory::class)->get('circles'); |
| 448 | 448 | $display = $l10n->t('%s (Circle owned by %s)', [$display, $circle->getOwner()->getDisplayName()]); |
| 449 | 449 | } else { |
| 450 | - $display .= ' (' . Circle::$DEF_SOURCE[$circle->getSource()] . ')'; |
|
| 450 | + $display .= ' ('.Circle::$DEF_SOURCE[$circle->getSource()].')'; |
|
| 451 | 451 | } |
| 452 | 452 | |
| 453 | 453 | $share->setSharedWithDisplayName($display); |
@@ -533,20 +533,20 @@ discard block |
||
| 533 | 533 | |
| 534 | 534 | public function importFromDatabase(array $data, string $prefix = ''): IQueryRow { |
| 535 | 535 | $shareTime = new DateTime(); |
| 536 | - $shareTime->setTimestamp($this->getInt($prefix . 'stime', $data)); |
|
| 537 | - |
|
| 538 | - $this->setId($this->get($prefix . 'id', $data)) |
|
| 539 | - ->setShareType($this->getInt($prefix . 'share_type', $data)) |
|
| 540 | - ->setPermissions($this->getInt($prefix . 'permissions', $data)) |
|
| 541 | - ->setItemType($this->get($prefix . 'item_type', $data)) |
|
| 542 | - ->setItemSource($this->getInt($prefix . 'item_source', $data)) |
|
| 543 | - ->setItemTarget($this->get($prefix . 'item_target', $data)) |
|
| 544 | - ->setFileSource($this->getInt($prefix . 'file_source', $data)) |
|
| 545 | - ->setFileTarget($this->get($prefix . 'file_target', $data)) |
|
| 546 | - ->setSharedWith($this->get($prefix . 'share_with', $data)) |
|
| 547 | - ->setSharedBy($this->get($prefix . 'uid_initiator', $data)) |
|
| 548 | - ->setShareOwner($this->get($prefix . 'uid_owner', $data)) |
|
| 549 | - ->setToken($this->get($prefix . 'token', $data)) |
|
| 536 | + $shareTime->setTimestamp($this->getInt($prefix.'stime', $data)); |
|
| 537 | + |
|
| 538 | + $this->setId($this->get($prefix.'id', $data)) |
|
| 539 | + ->setShareType($this->getInt($prefix.'share_type', $data)) |
|
| 540 | + ->setPermissions($this->getInt($prefix.'permissions', $data)) |
|
| 541 | + ->setItemType($this->get($prefix.'item_type', $data)) |
|
| 542 | + ->setItemSource($this->getInt($prefix.'item_source', $data)) |
|
| 543 | + ->setItemTarget($this->get($prefix.'item_target', $data)) |
|
| 544 | + ->setFileSource($this->getInt($prefix.'file_source', $data)) |
|
| 545 | + ->setFileTarget($this->get($prefix.'file_target', $data)) |
|
| 546 | + ->setSharedWith($this->get($prefix.'share_with', $data)) |
|
| 547 | + ->setSharedBy($this->get($prefix.'uid_initiator', $data)) |
|
| 548 | + ->setShareOwner($this->get($prefix.'uid_owner', $data)) |
|
| 549 | + ->setToken($this->get($prefix.'token', $data)) |
|
| 550 | 550 | ->setShareTime($shareTime); |
| 551 | 551 | |
| 552 | 552 | $this->importAttributesFromDatabase($this->get('attributes', $data)); |
@@ -557,9 +557,9 @@ discard block |
||
| 557 | 557 | // $share->setPassword($this->get('password', $data, '')); |
| 558 | 558 | // } |
| 559 | 559 | |
| 560 | - $this->setChildId($this->getInt($prefix . 'child_id', $data)) |
|
| 561 | - ->setChildFileTarget($this->get($prefix . 'child_file_target', $data)) |
|
| 562 | - ->setChildPermissions($this->getInt($prefix . 'child_permissions', $data)) |
|
| 560 | + $this->setChildId($this->getInt($prefix.'child_id', $data)) |
|
| 561 | + ->setChildFileTarget($this->get($prefix.'child_file_target', $data)) |
|
| 562 | + ->setChildPermissions($this->getInt($prefix.'child_permissions', $data)) |
|
| 563 | 563 | ->setProviderId(ShareByCircleProvider::IDENTIFIER) |
| 564 | 564 | ->setStatus(Ishare::STATUS_ACCEPTED); |
| 565 | 565 | |
@@ -398,8 +398,8 @@ discard block |
||
| 398 | 398 | foreach (explode(' ', $circle->getDisplayName()) as $word) { |
| 399 | 399 | $andX->add( |
| 400 | 400 | $expr->iLike( |
| 401 | - $this->getDefaultSelectAlias() . '.' . 'display_name', |
|
| 402 | - $this->createNamedParameter('%' . $word . '%') |
|
| 401 | + $this->getDefaultSelectAlias().'.'.'display_name', |
|
| 402 | + $this->createNamedParameter('%'.$word.'%') |
|
| 403 | 403 | ) |
| 404 | 404 | ); |
| 405 | 405 | } |
@@ -430,7 +430,7 @@ discard block |
||
| 430 | 430 | $this->generateRemoteInstanceSelectAlias($aliasRemoteInstance) |
| 431 | 431 | ->leftJoin( |
| 432 | 432 | $alias, CoreRequestBuilder::TABLE_REMOTE, $aliasRemoteInstance, |
| 433 | - $expr->eq($alias . '.instance', $aliasRemoteInstance . '.instance') |
|
| 433 | + $expr->eq($alias.'.instance', $aliasRemoteInstance.'.instance') |
|
| 434 | 434 | ); |
| 435 | 435 | } catch (RequestBuilderException $e) { |
| 436 | 436 | } |
@@ -482,7 +482,7 @@ discard block |
||
| 482 | 482 | $expr = $this->expr(); |
| 483 | 483 | $this->leftJoin( |
| 484 | 484 | $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_REMOTE, $aliasRemote, |
| 485 | - $expr->eq($aliasRemote . '.instance', $this->createNamedParameter($remoteInstance->getInstance())) |
|
| 485 | + $expr->eq($aliasRemote.'.instance', $this->createNamedParameter($remoteInstance->getInstance())) |
|
| 486 | 486 | ); |
| 487 | 487 | } |
| 488 | 488 | |
@@ -510,12 +510,12 @@ discard block |
||
| 510 | 510 | $this->leftJoin( |
| 511 | 511 | $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $aliasRemoteMember, |
| 512 | 512 | $expr->andX( |
| 513 | - $expr->eq($aliasRemoteMember . '.circle_id', $aliasCircle . '.unique_id'), |
|
| 513 | + $expr->eq($aliasRemoteMember.'.circle_id', $aliasCircle.'.unique_id'), |
|
| 514 | 514 | $expr->eq( |
| 515 | - $aliasRemoteMember . '.instance', |
|
| 515 | + $aliasRemoteMember.'.instance', |
|
| 516 | 516 | $this->createNamedParameter($remoteInstance->getInstance()) |
| 517 | 517 | ), |
| 518 | - $expr->gte($aliasRemoteMember . '.level', $this->createNamedParameter(Member::LEVEL_MEMBER)) |
|
| 518 | + $expr->gte($aliasRemoteMember.'.level', $this->createNamedParameter(Member::LEVEL_MEMBER)) |
|
| 519 | 519 | ) |
| 520 | 520 | ); |
| 521 | 521 | } |
@@ -547,21 +547,21 @@ discard block |
||
| 547 | 547 | $this->leftJoin( |
| 548 | 548 | $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $aliasRemoteCircle, |
| 549 | 549 | $expr->andX( |
| 550 | - $expr->eq($aliasRemoteCircle . '.single_id', $aliasCircle . '.unique_id'), |
|
| 551 | - $expr->emptyString($aliasRemoteCircle . '.instance'), |
|
| 552 | - $expr->gte($aliasRemoteCircle . '.level', $this->createNamedParameter(Member::LEVEL_MEMBER)) |
|
| 550 | + $expr->eq($aliasRemoteCircle.'.single_id', $aliasCircle.'.unique_id'), |
|
| 551 | + $expr->emptyString($aliasRemoteCircle.'.instance'), |
|
| 552 | + $expr->gte($aliasRemoteCircle.'.level', $this->createNamedParameter(Member::LEVEL_MEMBER)) |
|
| 553 | 553 | ) |
| 554 | 554 | ); |
| 555 | 555 | $this->leftJoin( |
| 556 | 556 | $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $aliasRemoteCircleOwner, |
| 557 | 557 | $expr->andX( |
| 558 | - $expr->eq($aliasRemoteCircle . '.circle_id', $aliasRemoteCircleOwner . '.circle_id'), |
|
| 558 | + $expr->eq($aliasRemoteCircle.'.circle_id', $aliasRemoteCircleOwner.'.circle_id'), |
|
| 559 | 559 | $expr->eq( |
| 560 | - $aliasRemoteCircleOwner . '.instance', |
|
| 560 | + $aliasRemoteCircleOwner.'.instance', |
|
| 561 | 561 | $this->createNamedParameter($remoteInstance->getInstance()) |
| 562 | 562 | ), |
| 563 | 563 | $expr->eq( |
| 564 | - $aliasRemoteCircleOwner . '.level', $this->createNamedParameter(Member::LEVEL_OWNER) |
|
| 564 | + $aliasRemoteCircleOwner.'.level', $this->createNamedParameter(Member::LEVEL_OWNER) |
|
| 565 | 565 | ) |
| 566 | 566 | ) |
| 567 | 567 | ); |
@@ -594,16 +594,16 @@ discard block |
||
| 594 | 594 | $expr = $this->expr(); |
| 595 | 595 | $orX = $expr->orX(); |
| 596 | 596 | $orX->add( |
| 597 | - $expr->eq($aliasRemote . '.type', $this->createNamedParameter(RemoteInstance::TYPE_GLOBALSCALE)) |
|
| 597 | + $expr->eq($aliasRemote.'.type', $this->createNamedParameter(RemoteInstance::TYPE_GLOBALSCALE)) |
|
| 598 | 598 | ); |
| 599 | 599 | |
| 600 | 600 | $orExtOrPassive = $expr->orX(); |
| 601 | 601 | $orExtOrPassive->add( |
| 602 | - $expr->eq($aliasRemote . '.type', $this->createNamedParameter(RemoteInstance::TYPE_EXTERNAL)) |
|
| 602 | + $expr->eq($aliasRemote.'.type', $this->createNamedParameter(RemoteInstance::TYPE_EXTERNAL)) |
|
| 603 | 603 | ); |
| 604 | 604 | if (!$sensitive) { |
| 605 | 605 | $orExtOrPassive->add( |
| 606 | - $expr->eq($aliasRemote . '.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE)) |
|
| 606 | + $expr->eq($aliasRemote.'.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE)) |
|
| 607 | 607 | ); |
| 608 | 608 | } else { |
| 609 | 609 | if ($this->getDefaultSelectAlias() === CoreQueryBuilder::MEMBER) { |
@@ -612,8 +612,8 @@ discard block |
||
| 612 | 612 | } |
| 613 | 613 | |
| 614 | 614 | $orInstance = $expr->orX(); |
| 615 | - $orInstance->add($expr->isNotNull($aliasRemoteMember . '.instance')); |
|
| 616 | - $orInstance->add($expr->isNotNull($aliasRemoteCircleOwner . '.instance')); |
|
| 615 | + $orInstance->add($expr->isNotNull($aliasRemoteMember.'.instance')); |
|
| 616 | + $orInstance->add($expr->isNotNull($aliasRemoteCircleOwner.'.instance')); |
|
| 617 | 617 | |
| 618 | 618 | $andExternal = $expr->andX(); |
| 619 | 619 | $andExternal->add($orExtOrPassive); |
@@ -622,13 +622,13 @@ discard block |
||
| 622 | 622 | $orExtOrTrusted = $expr->orX(); |
| 623 | 623 | $orExtOrTrusted->add($andExternal); |
| 624 | 624 | $orExtOrTrusted->add( |
| 625 | - $expr->eq($aliasRemote . '.type', $this->createNamedParameter(RemoteInstance::TYPE_TRUSTED)) |
|
| 625 | + $expr->eq($aliasRemote.'.type', $this->createNamedParameter(RemoteInstance::TYPE_TRUSTED)) |
|
| 626 | 626 | ); |
| 627 | 627 | |
| 628 | 628 | $andTrusted = $expr->andX(); |
| 629 | 629 | $andTrusted->add($orExtOrTrusted); |
| 630 | 630 | $andTrusted->add($this->exprLimitBitwise('config', Circle::CFG_FEDERATED, $aliasCircle)); |
| 631 | - $andTrusted->add($expr->emptyString($aliasOwner . '.instance')); |
|
| 631 | + $andTrusted->add($expr->emptyString($aliasOwner.'.instance')); |
|
| 632 | 632 | $orX->add($andTrusted); |
| 633 | 633 | |
| 634 | 634 | $this->andWhere($orX); |
@@ -655,7 +655,7 @@ discard block |
||
| 655 | 655 | } |
| 656 | 656 | $this->innerJoin( |
| 657 | 657 | $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $aliasMember, |
| 658 | - $expr->eq($aliasMember . '.circle_id', $alias . '.unique_id') |
|
| 658 | + $expr->eq($aliasMember.'.circle_id', $alias.'.unique_id') |
|
| 659 | 659 | ); |
| 660 | 660 | |
| 661 | 661 | $this->filterDirectMembership($aliasMember, $member); |
@@ -680,12 +680,12 @@ discard block |
||
| 680 | 680 | $aliasCircle, |
| 681 | 681 | 'circles_membership', |
| 682 | 682 | $aliasMembership, |
| 683 | - $this->expr()->eq($aliasCircle . '.unique_id', $aliasMembership . '.circle_id') |
|
| 683 | + $this->expr()->eq($aliasCircle.'.unique_id', $aliasMembership.'.circle_id') |
|
| 684 | 684 | ); |
| 685 | 685 | |
| 686 | 686 | $this->andWhere( |
| 687 | 687 | $this->expr()->eq( |
| 688 | - $aliasMembership . '.single_id', |
|
| 688 | + $aliasMembership.'.single_id', |
|
| 689 | 689 | $this->createNamedParameter($federatedUser->getSingleId()) |
| 690 | 690 | ) |
| 691 | 691 | ); |
@@ -706,19 +706,19 @@ discard block |
||
| 706 | 706 | |
| 707 | 707 | if ($member->getUserId() !== '') { |
| 708 | 708 | $andX->add( |
| 709 | - $expr->eq($aliasMember . '.user_id', $this->createNamedParameter($member->getUserId())) |
|
| 709 | + $expr->eq($aliasMember.'.user_id', $this->createNamedParameter($member->getUserId())) |
|
| 710 | 710 | ); |
| 711 | 711 | } |
| 712 | 712 | |
| 713 | 713 | if ($member->getSingleId() !== '') { |
| 714 | 714 | $andX->add( |
| 715 | - $expr->eq($aliasMember . '.single_id', $this->createNamedParameter($member->getSingleId())) |
|
| 715 | + $expr->eq($aliasMember.'.single_id', $this->createNamedParameter($member->getSingleId())) |
|
| 716 | 716 | ); |
| 717 | 717 | } |
| 718 | 718 | |
| 719 | 719 | if ($member->getUserType() > 0) { |
| 720 | 720 | $andX->add( |
| 721 | - $expr->eq($aliasMember . '.user_type', $this->createNamedParameter($member->getUserType())) |
|
| 721 | + $expr->eq($aliasMember.'.user_type', $this->createNamedParameter($member->getUserType())) |
|
| 722 | 722 | ); |
| 723 | 723 | } |
| 724 | 724 | |
@@ -727,7 +727,7 @@ discard block |
||
| 727 | 727 | if ($member->getLevel() > 0) { |
| 728 | 728 | $andX->add( |
| 729 | 729 | $expr->gte( |
| 730 | - $aliasMember . '.level', |
|
| 730 | + $aliasMember.'.level', |
|
| 731 | 731 | $this->createNamedParameter($member->getLevel(), IQueryBuilder::PARAM_INT) |
| 732 | 732 | ) |
| 733 | 733 | ); |
@@ -768,7 +768,7 @@ discard block |
||
| 768 | 768 | $helperAlias, |
| 769 | 769 | CoreRequestBuilder::TABLE_CIRCLE, |
| 770 | 770 | $aliasCircle, |
| 771 | - $expr->eq($aliasCircle . '.unique_id', $helperAlias . '.' . $field) |
|
| 771 | + $expr->eq($aliasCircle.'.unique_id', $helperAlias.'.'.$field) |
|
| 772 | 772 | ); |
| 773 | 773 | |
| 774 | 774 | if (!is_null($initiator)) { |
@@ -799,7 +799,7 @@ discard block |
||
| 799 | 799 | $this->generateCircleSelectAlias($aliasInvitedBy) |
| 800 | 800 | ->leftJoin( |
| 801 | 801 | $aliasMember, CoreRequestBuilder::TABLE_CIRCLE, $aliasInvitedBy, |
| 802 | - $expr->eq($aliasMember . '.invited_by', $aliasInvitedBy . '.unique_id') |
|
| 802 | + $expr->eq($aliasMember.'.invited_by', $aliasInvitedBy.'.unique_id') |
|
| 803 | 803 | ); |
| 804 | 804 | |
| 805 | 805 | $this->leftJoinOwner($aliasInvitedBy); |
@@ -830,7 +830,7 @@ discard block |
||
| 830 | 830 | $this->generateCircleSelectAlias($aliasBasedOn) |
| 831 | 831 | ->leftJoin( |
| 832 | 832 | $aliasMember, CoreRequestBuilder::TABLE_CIRCLE, $aliasBasedOn, |
| 833 | - $expr->eq($aliasBasedOn . '.unique_id', $aliasMember . '.single_id') |
|
| 833 | + $expr->eq($aliasBasedOn.'.unique_id', $aliasMember.'.single_id') |
|
| 834 | 834 | ); |
| 835 | 835 | |
| 836 | 836 | if (!is_null($initiator)) { |
@@ -863,9 +863,9 @@ discard block |
||
| 863 | 863 | ->leftJoin( |
| 864 | 864 | $alias, CoreRequestBuilder::TABLE_MEMBER, $aliasMember, |
| 865 | 865 | $expr->andX( |
| 866 | - $expr->eq($aliasMember . '.circle_id', $alias . '.' . $field), |
|
| 866 | + $expr->eq($aliasMember.'.circle_id', $alias.'.'.$field), |
|
| 867 | 867 | $expr->eq( |
| 868 | - $aliasMember . '.level', |
|
| 868 | + $aliasMember.'.level', |
|
| 869 | 869 | $this->createNamedParameter(Member::LEVEL_OWNER, self::PARAM_INT) |
| 870 | 870 | ) |
| 871 | 871 | ) |
@@ -897,7 +897,7 @@ discard block |
||
| 897 | 897 | |
| 898 | 898 | $expr = $this->expr(); |
| 899 | 899 | |
| 900 | - $on = $expr->andX($expr->eq($aliasMembership . '.circle_id', $alias . '.' . $field)); |
|
| 900 | + $on = $expr->andX($expr->eq($aliasMembership.'.circle_id', $alias.'.'.$field)); |
|
| 901 | 901 | |
| 902 | 902 | // limit on membership level if requested |
| 903 | 903 | $minLevel = $probe->getMinimumLevel(); |
@@ -938,8 +938,8 @@ discard block |
||
| 938 | 938 | ->leftJoin( |
| 939 | 939 | $alias, CoreRequestBuilder::TABLE_MEMBER, $aliasMember, |
| 940 | 940 | $expr->andX( |
| 941 | - $expr->eq($aliasMember . '.circle_id', $alias . '.' . $fieldCircleId), |
|
| 942 | - $expr->eq($aliasMember . '.single_id', $alias . '.' . $fieldSingleId), |
|
| 941 | + $expr->eq($aliasMember.'.circle_id', $alias.'.'.$fieldCircleId), |
|
| 942 | + $expr->eq($aliasMember.'.single_id', $alias.'.'.$fieldSingleId), |
|
| 943 | 943 | $this->exprGt('level', Member::LEVEL_MEMBER, true, $aliasMember) |
| 944 | 944 | ) |
| 945 | 945 | ); |
@@ -971,7 +971,7 @@ discard block |
||
| 971 | 971 | |
| 972 | 972 | $this->leftJoin( |
| 973 | 973 | $alias, CoreRequestBuilder::TABLE_MEMBERSHIP, $aliasMembership, |
| 974 | - $expr->eq($aliasMembership . '.circle_id', $alias . '.' . $field) |
|
| 974 | + $expr->eq($aliasMembership.'.circle_id', $alias.'.'.$field) |
|
| 975 | 975 | ); |
| 976 | 976 | |
| 977 | 977 | // if (!$this->getBool('getData', $options, false)) { |
@@ -985,8 +985,8 @@ discard block |
||
| 985 | 985 | ->leftJoin( |
| 986 | 986 | $alias, CoreRequestBuilder::TABLE_MEMBER, $aliasInheritedBy, |
| 987 | 987 | $expr->andX( |
| 988 | - $expr->eq($aliasMembership . '.inheritance_last', $aliasInheritedBy . '.circle_id'), |
|
| 989 | - $expr->eq($aliasMembership . '.single_id', $aliasInheritedBy . '.single_id') |
|
| 988 | + $expr->eq($aliasMembership.'.inheritance_last', $aliasInheritedBy.'.circle_id'), |
|
| 989 | + $expr->eq($aliasMembership.'.single_id', $aliasInheritedBy.'.single_id') |
|
| 990 | 990 | ) |
| 991 | 991 | ); |
| 992 | 992 | |
@@ -1003,12 +1003,12 @@ discard block |
||
| 1003 | 1003 | $aliasUpstreamMembership = $this->generateAlias($alias, self::UPSTREAM_MEMBERSHIPS, $options); |
| 1004 | 1004 | $this->leftJoin( |
| 1005 | 1005 | $alias, CoreRequestBuilder::TABLE_MEMBERSHIP, $aliasUpstreamMembership, |
| 1006 | - $expr->eq($aliasUpstreamMembership . '.single_id', $this->createNamedParameter($singleId)) |
|
| 1006 | + $expr->eq($aliasUpstreamMembership.'.single_id', $this->createNamedParameter($singleId)) |
|
| 1007 | 1007 | ); |
| 1008 | 1008 | |
| 1009 | 1009 | $orX = $expr->orX( |
| 1010 | - $expr->eq($aliasUpstreamMembership . '.circle_id', $alias . '.' . $field), |
|
| 1011 | - $expr->eq($alias . '.' . $field, $this->createNamedParameter($singleId)) |
|
| 1010 | + $expr->eq($aliasUpstreamMembership.'.circle_id', $alias.'.'.$field), |
|
| 1011 | + $expr->eq($alias.'.'.$field, $this->createNamedParameter($singleId)) |
|
| 1012 | 1012 | ); |
| 1013 | 1013 | |
| 1014 | 1014 | $this->andWhere($orX); |
@@ -1029,11 +1029,11 @@ discard block |
||
| 1029 | 1029 | |
| 1030 | 1030 | $expr = $this->expr(); |
| 1031 | 1031 | $aliasMembership = $this->generateAlias($alias, self::MEMBERSHIPS); |
| 1032 | - $this->andWhere($expr->eq($aliasMembership . '.circle_id', $this->createNamedParameter($singleId))); |
|
| 1032 | + $this->andWhere($expr->eq($aliasMembership.'.circle_id', $this->createNamedParameter($singleId))); |
|
| 1033 | 1033 | if ($level > 1) { |
| 1034 | 1034 | $this->andWhere( |
| 1035 | 1035 | $expr->gte( |
| 1036 | - $aliasMembership . '.level', |
|
| 1036 | + $aliasMembership.'.level', |
|
| 1037 | 1037 | $this->createNamedParameter($level, IQueryBuilder::PARAM_INT) |
| 1038 | 1038 | ) |
| 1039 | 1039 | ); |
@@ -1061,8 +1061,8 @@ discard block |
||
| 1061 | 1061 | $this->leftJoin( |
| 1062 | 1062 | $alias, CoreRequestBuilder::TABLE_MEMBERSHIP, $aliasMembership, |
| 1063 | 1063 | $expr->andX( |
| 1064 | - $expr->eq($aliasMembership . '.inheritance_last', $alias . '.' . $field), |
|
| 1065 | - $expr->eq($aliasMembership . '.single_id', $alias . '.single_id') |
|
| 1064 | + $expr->eq($aliasMembership.'.inheritance_last', $alias.'.'.$field), |
|
| 1065 | + $expr->eq($aliasMembership.'.single_id', $alias.'.single_id') |
|
| 1066 | 1066 | ) |
| 1067 | 1067 | ); |
| 1068 | 1068 | |
@@ -1075,8 +1075,8 @@ discard block |
||
| 1075 | 1075 | ->leftJoin( |
| 1076 | 1076 | $aliasMembership, CoreRequestBuilder::TABLE_MEMBER, $aliasInheritanceFrom, |
| 1077 | 1077 | $expr->andX( |
| 1078 | - $expr->eq($aliasMembership . '.circle_id', $aliasInheritanceFrom . '.circle_id'), |
|
| 1079 | - $expr->eq($aliasMembership . '.inheritance_first', $aliasInheritanceFrom . '.single_id') |
|
| 1078 | + $expr->eq($aliasMembership.'.circle_id', $aliasInheritanceFrom.'.circle_id'), |
|
| 1079 | + $expr->eq($aliasMembership.'.inheritance_first', $aliasInheritanceFrom.'.single_id') |
|
| 1080 | 1080 | ) |
| 1081 | 1081 | ); |
| 1082 | 1082 | } |
@@ -1116,7 +1116,7 @@ discard block |
||
| 1116 | 1116 | |
| 1117 | 1117 | $this->leftJoin( |
| 1118 | 1118 | $alias, CoreRequestBuilder::TABLE_TOKEN, $aliasShareToken, |
| 1119 | - $expr->eq($aliasShareToken . '.share_id', $alias . '.' . $field) |
|
| 1119 | + $expr->eq($aliasShareToken.'.share_id', $alias.'.'.$field) |
|
| 1120 | 1120 | ); |
| 1121 | 1121 | } |
| 1122 | 1122 | |
@@ -1158,14 +1158,14 @@ discard block |
||
| 1158 | 1158 | try { |
| 1159 | 1159 | $aliasConfig = $this->generateAlias($alias, self::CONFIG, $options); |
| 1160 | 1160 | $this->selectAlias( |
| 1161 | - $aliasConfig . '.config', |
|
| 1162 | - (($alias !== $this->getDefaultSelectAlias()) ? $alias . '_' : '') . 'circle_config' |
|
| 1161 | + $aliasConfig.'.config', |
|
| 1162 | + (($alias !== $this->getDefaultSelectAlias()) ? $alias.'_' : '').'circle_config' |
|
| 1163 | 1163 | ); |
| 1164 | 1164 | $this->leftJoin( |
| 1165 | 1165 | $alias, |
| 1166 | 1166 | CoreRequestBuilder::TABLE_CIRCLE, |
| 1167 | 1167 | $aliasConfig, |
| 1168 | - $expr->eq($alias . '.circle_id', $aliasConfig . '.unique_id') |
|
| 1168 | + $expr->eq($alias.'.circle_id', $aliasConfig.'.unique_id') |
|
| 1169 | 1169 | ); |
| 1170 | 1170 | } catch (RequestBuilderException $e) { |
| 1171 | 1171 | } |
@@ -1203,7 +1203,7 @@ discard block |
||
| 1203 | 1203 | $aliasMembership, |
| 1204 | 1204 | $expr->andX( |
| 1205 | 1205 | $this->exprLimit('single_id', $initiator->getSingleId(), $aliasMembership), |
| 1206 | - $expr->eq($aliasMembership . '.circle_id', $helperAlias . '.' . $field) |
|
| 1206 | + $expr->eq($aliasMembership.'.circle_id', $helperAlias.'.'.$field) |
|
| 1207 | 1207 | ) |
| 1208 | 1208 | ); |
| 1209 | 1209 | |
@@ -1222,11 +1222,11 @@ discard block |
||
| 1222 | 1222 | $aliasMembershipCircle = $this->generateAlias($aliasMembership, self::CONFIG, $options); |
| 1223 | 1223 | $orXMembershipCircle = $expr->orX(); |
| 1224 | 1224 | array_map( |
| 1225 | - function (string $alias) use ($orXMembershipCircle, $aliasMembershipCircle) { |
|
| 1225 | + function(string $alias) use ($orXMembershipCircle, $aliasMembershipCircle) { |
|
| 1226 | 1226 | $orXMembershipCircle->add( |
| 1227 | 1227 | $this->expr()->eq( |
| 1228 | - $alias . '.circle_id', |
|
| 1229 | - $aliasMembershipCircle . '.unique_id' |
|
| 1228 | + $alias.'.circle_id', |
|
| 1229 | + $aliasMembershipCircle.'.unique_id' |
|
| 1230 | 1230 | ) |
| 1231 | 1231 | ); |
| 1232 | 1232 | }, |
@@ -1258,7 +1258,7 @@ discard block |
||
| 1258 | 1258 | $aliasDirectInitiator, |
| 1259 | 1259 | $expr->andX( |
| 1260 | 1260 | $this->exprLimit('single_id', $initiator->getSingleId(), $aliasDirectInitiator), |
| 1261 | - $expr->eq($aliasDirectInitiator . '.circle_id', $helperAlias . '.' . $field) |
|
| 1261 | + $expr->eq($aliasDirectInitiator.'.circle_id', $helperAlias.'.'.$field) |
|
| 1262 | 1262 | ) |
| 1263 | 1263 | ); |
| 1264 | 1264 | } catch (RequestBuilderException $e) { |
@@ -1272,8 +1272,8 @@ discard block |
||
| 1272 | 1272 | $this->leftJoin( |
| 1273 | 1273 | $aliasMembership, CoreRequestBuilder::TABLE_MEMBER, $aliasInitiator, |
| 1274 | 1274 | $expr->andX( |
| 1275 | - $expr->eq($aliasMembership . '.inheritance_first', $aliasInitiator . '.single_id'), |
|
| 1276 | - $expr->eq($aliasMembership . '.circle_id', $aliasInitiator . '.circle_id') |
|
| 1275 | + $expr->eq($aliasMembership.'.inheritance_first', $aliasInitiator.'.single_id'), |
|
| 1276 | + $expr->eq($aliasMembership.'.circle_id', $aliasInitiator.'.circle_id') |
|
| 1277 | 1277 | ) |
| 1278 | 1278 | ); |
| 1279 | 1279 | |
@@ -1281,8 +1281,8 @@ discard block |
||
| 1281 | 1281 | $this->leftJoin( |
| 1282 | 1282 | $aliasInitiator, CoreRequestBuilder::TABLE_MEMBER, $aliasInheritedBy, |
| 1283 | 1283 | $expr->andX( |
| 1284 | - $expr->eq($aliasMembership . '.single_id', $aliasInheritedBy . '.single_id'), |
|
| 1285 | - $expr->eq($aliasMembership . '.inheritance_last', $aliasInheritedBy . '.circle_id') |
|
| 1284 | + $expr->eq($aliasMembership.'.single_id', $aliasInheritedBy.'.single_id'), |
|
| 1285 | + $expr->eq($aliasMembership.'.inheritance_last', $aliasInheritedBy.'.circle_id') |
|
| 1286 | 1286 | ) |
| 1287 | 1287 | ); |
| 1288 | 1288 | |
@@ -1327,7 +1327,7 @@ discard block |
||
| 1327 | 1327 | ->leftJoin( |
| 1328 | 1328 | $alias, CoreRequestBuilder::TABLE_MEMBER, $aliasInitiator, |
| 1329 | 1329 | $expr->andX( |
| 1330 | - $expr->eq($aliasInitiator . '.circle_id', $helperAlias . '.' . $field), |
|
| 1330 | + $expr->eq($aliasInitiator.'.circle_id', $helperAlias.'.'.$field), |
|
| 1331 | 1331 | $this->exprLimitInt('level', Member::LEVEL_OWNER, $aliasInitiator) |
| 1332 | 1332 | ) |
| 1333 | 1333 | ); |
@@ -1365,7 +1365,7 @@ discard block |
||
| 1365 | 1365 | $orX->add( |
| 1366 | 1366 | $expr->andX( |
| 1367 | 1367 | $this->exprLimitBitwise('config', Circle::CFG_PERSONAL, $aliasMembershipCircle), |
| 1368 | - $expr->eq($aliasMembership . '.level', $this->createNamedParameter(Member::LEVEL_OWNER)) |
|
| 1368 | + $expr->eq($aliasMembership.'.level', $this->createNamedParameter(Member::LEVEL_OWNER)) |
|
| 1369 | 1369 | ) |
| 1370 | 1370 | ); |
| 1371 | 1371 | } |
@@ -1375,10 +1375,10 @@ discard block |
||
| 1375 | 1375 | $orXLevelCheck = $expr->orX(); |
| 1376 | 1376 | |
| 1377 | 1377 | array_map( |
| 1378 | - function (string $alias) use ($orXLevelCheck, $minimumLevel) { |
|
| 1378 | + function(string $alias) use ($orXLevelCheck, $minimumLevel) { |
|
| 1379 | 1379 | $orXLevelCheck->add( |
| 1380 | 1380 | $this->expr()->gte( |
| 1381 | - $alias . '.level', |
|
| 1381 | + $alias.'.level', |
|
| 1382 | 1382 | $this->createNamedParameter($minimumLevel, self::PARAM_INT) |
| 1383 | 1383 | ) |
| 1384 | 1384 | ); |
@@ -1459,21 +1459,21 @@ discard block |
||
| 1459 | 1459 | $expr = $this->expr(); |
| 1460 | 1460 | $andPassive = $expr->andX(); |
| 1461 | 1461 | $andPassive->add( |
| 1462 | - $expr->eq($alias . '.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE)) |
|
| 1462 | + $expr->eq($alias.'.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE)) |
|
| 1463 | 1463 | ); |
| 1464 | 1464 | |
| 1465 | 1465 | $orMemberOrLevel = $expr->orX(); |
| 1466 | 1466 | $orMemberOrLevel->add( |
| 1467 | - $expr->eq($this->getDefaultSelectAlias() . '.instance', $alias . '.instance') |
|
| 1467 | + $expr->eq($this->getDefaultSelectAlias().'.instance', $alias.'.instance') |
|
| 1468 | 1468 | ); |
| 1469 | 1469 | // TODO: do we need this ? (display members from the local instance) |
| 1470 | 1470 | $orMemberOrLevel->add( |
| 1471 | - $expr->emptyString($this->getDefaultSelectAlias() . '.instance') |
|
| 1471 | + $expr->emptyString($this->getDefaultSelectAlias().'.instance') |
|
| 1472 | 1472 | ); |
| 1473 | 1473 | |
| 1474 | 1474 | $orMemberOrLevel->add( |
| 1475 | 1475 | $expr->eq( |
| 1476 | - $this->getDefaultSelectAlias() . '.level', |
|
| 1476 | + $this->getDefaultSelectAlias().'.level', |
|
| 1477 | 1477 | $this->createNamedParameter(Member::LEVEL_OWNER) |
| 1478 | 1478 | ) |
| 1479 | 1479 | ); |
@@ -1510,11 +1510,11 @@ discard block |
||
| 1510 | 1510 | ) |
| 1511 | 1511 | ->leftJoin( |
| 1512 | 1512 | $aliasShare, CoreRequestBuilder::TABLE_FILE_CACHE, $aliasFileCache, |
| 1513 | - $expr->eq($aliasShare . '.file_source', $aliasFileCache . '.fileid') |
|
| 1513 | + $expr->eq($aliasShare.'.file_source', $aliasFileCache.'.fileid') |
|
| 1514 | 1514 | ) |
| 1515 | 1515 | ->leftJoin( |
| 1516 | 1516 | $aliasFileCache, CoreRequestBuilder::TABLE_STORAGES, $aliasStorages, |
| 1517 | - $expr->eq($aliasFileCache . '.storage', $aliasStorages . '.numeric_id') |
|
| 1517 | + $expr->eq($aliasFileCache.'.storage', $aliasStorages.'.numeric_id') |
|
| 1518 | 1518 | ); |
| 1519 | 1519 | } |
| 1520 | 1520 | |
@@ -1536,8 +1536,8 @@ discard block |
||
| 1536 | 1536 | $this->leftJoin( |
| 1537 | 1537 | $aliasShareMemberships, CoreRequestBuilder::TABLE_SHARE, $aliasShareChild, |
| 1538 | 1538 | $expr->andX( |
| 1539 | - $expr->eq($aliasShareChild . '.parent', $aliasShare . '.id'), |
|
| 1540 | - $expr->eq($aliasShareChild . '.share_with', $aliasShareMemberships . '.single_id') |
|
| 1539 | + $expr->eq($aliasShareChild.'.parent', $aliasShare.'.id'), |
|
| 1540 | + $expr->eq($aliasShareChild.'.share_with', $aliasShareMemberships.'.single_id') |
|
| 1541 | 1541 | ) |
| 1542 | 1542 | ); |
| 1543 | 1543 | |
@@ -1595,13 +1595,13 @@ discard block |
||
| 1595 | 1595 | $this->leftJoin( |
| 1596 | 1596 | $aliasMountMemberships, CoreRequestBuilder::TABLE_MOUNTPOINT, $aliasMountpoint, |
| 1597 | 1597 | $expr->andX( |
| 1598 | - $expr->eq($aliasMountpoint . '.mount_id', $aliasMount . '.mount_id'), |
|
| 1599 | - $expr->eq($aliasMountpoint . '.single_id', $aliasMountMemberships . '.single_id') |
|
| 1598 | + $expr->eq($aliasMountpoint.'.mount_id', $aliasMount.'.mount_id'), |
|
| 1599 | + $expr->eq($aliasMountpoint.'.single_id', $aliasMountMemberships.'.single_id') |
|
| 1600 | 1600 | ) |
| 1601 | 1601 | ); |
| 1602 | 1602 | |
| 1603 | - $this->selectAlias($aliasMountpoint . '.mountpoint', $aliasMountpoint . '_mountpoint'); |
|
| 1604 | - $this->selectAlias($aliasMountpoint . '.mountpoint_hash', $aliasMountpoint . '_mountpoint_hash'); |
|
| 1603 | + $this->selectAlias($aliasMountpoint.'.mountpoint', $aliasMountpoint.'_mountpoint'); |
|
| 1604 | + $this->selectAlias($aliasMountpoint.'.mountpoint_hash', $aliasMountpoint.'_mountpoint_hash'); |
|
| 1605 | 1605 | } |
| 1606 | 1606 | |
| 1607 | 1607 | |
@@ -1709,10 +1709,10 @@ discard block |
||
| 1709 | 1709 | */ |
| 1710 | 1710 | public function generateAlias(string $base, string $extension, ?array &$options = []): string { |
| 1711 | 1711 | $search = str_replace('_', '.', $base); |
| 1712 | - $path = $search . '.' . $extension; |
|
| 1712 | + $path = $search.'.'.$extension; |
|
| 1713 | 1713 | if (!$this->validKey($path, $this->getSqlPath()) |
| 1714 | 1714 | && !in_array($extension, $this->getArray($search, $this->getSqlPath()))) { |
| 1715 | - throw new RequestBuilderException($extension . ' not found in ' . $search); |
|
| 1715 | + throw new RequestBuilderException($extension.' not found in '.$search); |
|
| 1716 | 1716 | } |
| 1717 | 1717 | |
| 1718 | 1718 | if (!is_array($options)) { |
@@ -1721,15 +1721,15 @@ discard block |
||
| 1721 | 1721 | |
| 1722 | 1722 | $optionPath = ''; |
| 1723 | 1723 | foreach (explode('.', $path) as $p) { |
| 1724 | - $optionPath = trim($optionPath . '.' . $p, '.'); |
|
| 1724 | + $optionPath = trim($optionPath.'.'.$p, '.'); |
|
| 1725 | 1725 | $options = array_merge( |
| 1726 | 1726 | $options, |
| 1727 | - $this->getArray($optionPath . '.' . self::OPTIONS, $this->getSqlPath()), |
|
| 1728 | - $this->getArray($optionPath . '.' . self::OPTIONS, $this->options) |
|
| 1727 | + $this->getArray($optionPath.'.'.self::OPTIONS, $this->getSqlPath()), |
|
| 1728 | + $this->getArray($optionPath.'.'.self::OPTIONS, $this->options) |
|
| 1729 | 1729 | ); |
| 1730 | 1730 | } |
| 1731 | 1731 | |
| 1732 | - return $base . '_' . $extension; |
|
| 1732 | + return $base.'_'.$extension; |
|
| 1733 | 1733 | } |
| 1734 | 1734 | |
| 1735 | 1735 | |
@@ -1749,7 +1749,7 @@ discard block |
||
| 1749 | 1749 | } else { |
| 1750 | 1750 | $k = $arr; |
| 1751 | 1751 | } |
| 1752 | - $path[$k] = $prefix . '_' . $k . '_'; |
|
| 1752 | + $path[$k] = $prefix.'_'.$k.'_'; |
|
| 1753 | 1753 | } |
| 1754 | 1754 | |
| 1755 | 1755 | return $path; |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | } catch (FederatedItemException $e) { |
| 130 | 130 | if ($input->getOption('status-code')) { |
| 131 | 131 | throw new FederatedItemException( |
| 132 | - ' [' . get_class($e) . ', ' . $e->getStatus() . ']' . "\n" . $e->getMessage() |
|
| 132 | + ' ['.get_class($e).', '.$e->getStatus().']'."\n".$e->getMessage() |
|
| 133 | 133 | ); |
| 134 | 134 | } |
| 135 | 135 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | $instance = $host; |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | - $result[] = $user['userid']['value'] . ' <info>@' . $host . '</info>'; |
|
| 192 | + $result[] = $user['userid']['value'].' <info>@'.$host.'</info>'; |
|
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | // if ($userId === '') { |
@@ -212,10 +212,10 @@ discard block |
||
| 212 | 212 | // return 0; |
| 213 | 213 | // } |
| 214 | 214 | |
| 215 | - $output->writeln('Id: <info>' . $federatedUser->getUserId() . '</info>'); |
|
| 216 | - $output->writeln('Instance: <info>' . $federatedUser->getInstance() . '</info>'); |
|
| 217 | - $output->writeln('Type: <info>' . Member::$TYPE[$federatedUser->getUserType()] . '</info>'); |
|
| 218 | - $output->writeln('SingleId: <info>' . $federatedUser->getSingleId() . '</info>'); |
|
| 215 | + $output->writeln('Id: <info>'.$federatedUser->getUserId().'</info>'); |
|
| 216 | + $output->writeln('Instance: <info>'.$federatedUser->getInstance().'</info>'); |
|
| 217 | + $output->writeln('Type: <info>'.Member::$TYPE[$federatedUser->getUserType()].'</info>'); |
|
| 218 | + $output->writeln('SingleId: <info>'.$federatedUser->getSingleId().'</info>'); |
|
| 219 | 219 | |
| 220 | 220 | $output->writeln(''); |
| 221 | 221 | $output->writeln('Memberships:'); |
@@ -224,14 +224,14 @@ discard block |
||
| 224 | 224 | if ($count === 0) { |
| 225 | 225 | $output->writeln('(database not updated)'); |
| 226 | 226 | } else { |
| 227 | - $output->writeln('(' . $count . ' entries generated/updated in the database)'); |
|
| 227 | + $output->writeln('('.$count.' entries generated/updated in the database)'); |
|
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | foreach ($federatedUser->getMemberships() as $membership) { |
| 231 | 231 | $this->memberships[$membership->getCircleId()] = $membership; |
| 232 | 232 | $output->writeln( |
| 233 | - '- <info>' . $membership->getCircleId() . '</info> (' |
|
| 234 | - . Member::$DEF_LEVEL[$membership->getLevel()] . ')' |
|
| 233 | + '- <info>'.$membership->getCircleId().'</info> (' |
|
| 234 | + . Member::$DEF_LEVEL[$membership->getLevel()].')' |
|
| 235 | 235 | ); |
| 236 | 236 | } |
| 237 | 237 | |
@@ -305,9 +305,9 @@ discard block |
||
| 305 | 305 | if ($lineNumber === 2) { |
| 306 | 306 | return ''; |
| 307 | 307 | } |
| 308 | - $line .= '<info>' . $federatedUser->getSingleId() . '</info>'; |
|
| 308 | + $line .= '<info>'.$federatedUser->getSingleId().'</info>'; |
|
| 309 | 309 | if (!$this->configService->isLocalInstance($federatedUser->getInstance())) { |
| 310 | - $line .= '@' . $federatedUser->getInstance(); |
|
| 310 | + $line .= '@'.$federatedUser->getInstance(); |
|
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | return $line; |
@@ -319,28 +319,28 @@ discard block |
||
| 319 | 319 | $circle = $member->getCircle(); |
| 320 | 320 | |
| 321 | 321 | if ($lineNumber === 1) { |
| 322 | - $line .= '<info>' . $circle->getSingleId() . '</info>'; |
|
| 322 | + $line .= '<info>'.$circle->getSingleId().'</info>'; |
|
| 323 | 323 | if (!$this->configService->isLocalInstance($circle->getInstance())) { |
| 324 | - $line .= '@' . $circle->getInstance(); |
|
| 324 | + $line .= '@'.$circle->getInstance(); |
|
| 325 | 325 | } |
| 326 | - $line .= ' (' . ($this->input->getOption('display-name') ? |
|
| 327 | - $circle->getDisplayName() : $circle->getName()) . ')'; |
|
| 328 | - $line .= ' <info>MemberId</info>: ' . $member->getId(); |
|
| 329 | - $line .= ' <info>Level</info>: ' . Member::$DEF_LEVEL[$member->getLevel()]; |
|
| 326 | + $line .= ' ('.($this->input->getOption('display-name') ? |
|
| 327 | + $circle->getDisplayName() : $circle->getName()).')'; |
|
| 328 | + $line .= ' <info>MemberId</info>: '.$member->getId(); |
|
| 329 | + $line .= ' <info>Level</info>: '.Member::$DEF_LEVEL[$member->getLevel()]; |
|
| 330 | 330 | |
| 331 | 331 | $knownMembership = $this->memberships[$member->getCircleId()]; |
| 332 | 332 | if ($member->getLevel() !== $knownMembership->getLevel()) { |
| 333 | - $line .= ' (' . Member::$DEF_LEVEL[$knownMembership->getLevel()] . ')'; |
|
| 333 | + $line .= ' ('.Member::$DEF_LEVEL[$knownMembership->getLevel()].')'; |
|
| 334 | 334 | } |
| 335 | 335 | } |
| 336 | 336 | if ($lineNumber === 2) { |
| 337 | 337 | $owner = $circle->getOwner(); |
| 338 | - $line .= '<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance() . ' '; |
|
| 338 | + $line .= '<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance().' '; |
|
| 339 | 339 | if ($owner->hasBasedOn()) { |
| 340 | - $line .= '(' . Circle::$DEF_SOURCE[$owner->getBasedOn()->getSource()] . ') '; |
|
| 340 | + $line .= '('.Circle::$DEF_SOURCE[$owner->getBasedOn()->getSource()].') '; |
|
| 341 | 341 | } |
| 342 | 342 | $type = implode(", ", Circle::getCircleFlags($circle, Circle::FLAGS_LONG)); |
| 343 | - $line .= ($type === '') ? '' : '<info>Config</info>: ' . $type; |
|
| 343 | + $line .= ($type === '') ? '' : '<info>Config</info>: '.$type; |
|
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | return $line; |
@@ -399,6 +399,6 @@ discard block |
||
| 399 | 399 | ); |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | - $output->writeln($count . ' memberships updated'); |
|
| 402 | + $output->writeln($count.' memberships updated'); |
|
| 403 | 403 | } |
| 404 | 404 | } |
@@ -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 | } |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | $this->parseAsNonMember($event, $circle); |
| 69 | 69 | $this->parseAsMember($event, $circle, $params); |
| 70 | 70 | $this->parseAsModerator($event, $circle, $params); |
| 71 | - } catch (FakeException|InvalidItemException $e) { |
|
| 71 | + } catch (FakeException | InvalidItemException $e) { |
|
| 72 | 72 | /** clean exit */ |
| 73 | 73 | } |
| 74 | 74 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | throw new Exception('Please specify a --type for the test'); |
| 131 | 131 | } |
| 132 | 132 | if ($test !== '' && !in_array($type, self::$checks)) { |
| 133 | - throw new Exception('Unknown type: ' . implode(', ', self::$checks)); |
|
| 133 | + throw new Exception('Unknown type: '.implode(', ', self::$checks)); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | // $this->configService->setAppValue(ConfigService::TEST_NC_BASE, $test); |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | $output->writeln(''); |
| 189 | - $output->writeln('* testing current address: ' . $test); |
|
| 189 | + $output->writeln('* testing current address: '.$test); |
|
| 190 | 190 | |
| 191 | 191 | try { |
| 192 | 192 | $this->setupLoopback($input, $output, $test); |
@@ -220,8 +220,8 @@ discard block |
||
| 220 | 220 | continue; |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | - $loopback = rtrim($scheme . '://' . $cloudId . $path, '/'); |
|
| 224 | - $output->writeln('* testing address: ' . $loopback . ' '); |
|
| 223 | + $loopback = rtrim($scheme.'://'.$cloudId.$path, '/'); |
|
| 224 | + $output->writeln('* testing address: '.$loopback.' '); |
|
| 225 | 225 | |
| 226 | 226 | try { |
| 227 | 227 | $this->setupLoopback($input, $output, $loopback); |
@@ -292,8 +292,8 @@ discard block |
||
| 292 | 292 | $test = new FederatedEvent(LoopbackTest::class); |
| 293 | 293 | $this->federatedEventService->newEvent($test); |
| 294 | 294 | $output->writeln( |
| 295 | - '<info>' . $test->getWrapperToken() . '</info> ' . |
|
| 296 | - '(took ' . (round(microtime(true) * 1000) - $timer) . 'ms)' |
|
| 295 | + '<info>'.$test->getWrapperToken().'</info> '. |
|
| 296 | + '(took '.(round(microtime(true) * 1000) - $timer).'ms)' |
|
| 297 | 297 | ); |
| 298 | 298 | |
| 299 | 299 | $output->writeln('- Waiting for async process to finish (5s)'); |
@@ -312,18 +312,18 @@ discard block |
||
| 312 | 312 | |
| 313 | 313 | $checkVerify = $wrapper->getEvent()->getData()->gInt('verify'); |
| 314 | 314 | if ($checkVerify === LoopbackTest::VERIFY) { |
| 315 | - $output->write('<info>verify=' . $checkVerify . '</info> '); |
|
| 315 | + $output->write('<info>verify='.$checkVerify.'</info> '); |
|
| 316 | 316 | } else { |
| 317 | - $output->writeln('<error>verify=' . $checkVerify . '</error>'); |
|
| 317 | + $output->writeln('<error>verify='.$checkVerify.'</error>'); |
|
| 318 | 318 | |
| 319 | 319 | return false; |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | $checkManage = $wrapper->getResult()->gInt('manage'); |
| 323 | 323 | if ($checkManage === LoopbackTest::MANAGE) { |
| 324 | - $output->write('<info>manage=' . $checkManage . '</info> '); |
|
| 324 | + $output->write('<info>manage='.$checkManage.'</info> '); |
|
| 325 | 325 | } else { |
| 326 | - $output->writeln('<error>manage=' . $checkManage . '</error>'); |
|
| 326 | + $output->writeln('<error>manage='.$checkManage.'</error>'); |
|
| 327 | 327 | |
| 328 | 328 | return false; |
| 329 | 329 | } |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | $this->configService->setAppValue(ConfigService::LOOPBACK_CLOUD_ID, $cloudId); |
| 362 | 362 | $this->configService->setAppValue(ConfigService::LOOPBACK_CLOUD_PATH, $path); |
| 363 | 363 | $output->writeln( |
| 364 | - '- Address <info>' . $loopback . '</info> is now used as <info>loopback</info>' |
|
| 364 | + '- Address <info>'.$loopback.'</info> is now used as <info>loopback</info>' |
|
| 365 | 365 | ); |
| 366 | 366 | } |
| 367 | 367 | |
@@ -413,8 +413,8 @@ discard block |
||
| 413 | 413 | continue; |
| 414 | 414 | } |
| 415 | 415 | |
| 416 | - $internal = rtrim($scheme . '://' . $cloudId, '/'); |
|
| 417 | - $fullInternal = rtrim($scheme . '://' . $cloudId . $path, '/'); |
|
| 416 | + $internal = rtrim($scheme.'://'.$cloudId, '/'); |
|
| 417 | + $fullInternal = rtrim($scheme.'://'.$cloudId.$path, '/'); |
|
| 418 | 418 | |
| 419 | 419 | $question = new ConfirmationQuestion( |
| 420 | 420 | '<comment>Do you want to check the validity of this internal address?</comment> (Y/n) ', true, |
@@ -433,9 +433,9 @@ discard block |
||
| 433 | 433 | 'You will need to run this <info>curl</info> command from a terminal on your local network and paste its result: ' |
| 434 | 434 | ); |
| 435 | 435 | $output->writeln( |
| 436 | - ' curl -L "' . $internal |
|
| 436 | + ' curl -L "'.$internal |
|
| 437 | 437 | . '/.well-known/webfinger?resource=http://nextcloud.com/&test=' |
| 438 | - . $testToken . '"' |
|
| 438 | + . $testToken.'"' |
|
| 439 | 439 | ); |
| 440 | 440 | |
| 441 | 441 | $output->writeln('paste the result here: '); |
@@ -469,7 +469,7 @@ discard block |
||
| 469 | 469 | |
| 470 | 470 | if ($pastedHref !== $href) { |
| 471 | 471 | $output->writeln( |
| 472 | - '<error>The returned data (' . $pastedHref . ') are not the one expected: </error>' |
|
| 472 | + '<error>The returned data ('.$pastedHref.') are not the one expected: </error>' |
|
| 473 | 473 | . $href |
| 474 | 474 | ); |
| 475 | 475 | continue; |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | 'Next step, please run this <info>curl</info> command from a terminal on your local network and paste its result: ' |
| 482 | 482 | ); |
| 483 | 483 | $output->writeln( |
| 484 | - ' curl -L "' . $pastedHref . '?test=' . $testToken . '" -H "Accept: application/json"' |
|
| 484 | + ' curl -L "'.$pastedHref.'?test='.$testToken.'" -H "Accept: application/json"' |
|
| 485 | 485 | ); |
| 486 | 486 | |
| 487 | 487 | $output->writeln('paste the result here: '); |
@@ -497,9 +497,9 @@ discard block |
||
| 497 | 497 | || $appSignatory->getRoot() !== $pastedSignatory->g('root')) { |
| 498 | 498 | $output->writeln( |
| 499 | 499 | '<error>The returned data (' |
| 500 | - . $pastedSignatory->g('uid') . '/' . $pastedSignatory->g('root') |
|
| 500 | + . $pastedSignatory->g('uid').'/'.$pastedSignatory->g('root') |
|
| 501 | 501 | . ') are not the one expected: </error>' |
| 502 | - . $appSignatory->getUid(true) . '/' . $appSignatory->getRoot() |
|
| 502 | + . $appSignatory->getUid(true).'/'.$appSignatory->getRoot() |
|
| 503 | 503 | ); |
| 504 | 504 | continue; |
| 505 | 505 | } |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | |
| 526 | 526 | $output->writeln(''); |
| 527 | 527 | $question = new ConfirmationQuestion( |
| 528 | - '- Do you want to save <info>' . $internal |
|
| 528 | + '- Do you want to save <info>'.$internal |
|
| 529 | 529 | . '</info> as your <info>internal</info> address ? (y/N) ', |
| 530 | 530 | false, '/^(y|Y)/i' |
| 531 | 531 | ); |
@@ -541,7 +541,7 @@ discard block |
||
| 541 | 541 | $this->configService->setAppValue(ConfigService::INTERNAL_CLOUD_ID, $cloudId); |
| 542 | 542 | $this->configService->setAppValue(ConfigService::INTERNAL_CLOUD_PATH, $path); |
| 543 | 543 | |
| 544 | - $output->writeln('- Address <info>' . $internal . '</info> is now used as <info>internal</info>'); |
|
| 544 | + $output->writeln('- Address <info>'.$internal.'</info> is now used as <info>internal</info>'); |
|
| 545 | 545 | } |
| 546 | 546 | |
| 547 | 547 | /** |
@@ -591,8 +591,8 @@ discard block |
||
| 591 | 591 | continue; |
| 592 | 592 | } |
| 593 | 593 | |
| 594 | - $frontal = rtrim($scheme . '://' . $cloudId, '/'); |
|
| 595 | - $fullFrontal = rtrim($scheme . '://' . $cloudId . $path, '/'); |
|
| 594 | + $frontal = rtrim($scheme.'://'.$cloudId, '/'); |
|
| 595 | + $fullFrontal = rtrim($scheme.'://'.$cloudId.$path, '/'); |
|
| 596 | 596 | |
| 597 | 597 | $question = new ConfirmationQuestion( |
| 598 | 598 | '<comment>Do you want to check the validity of this frontal address?</comment> (y/N) ', false, |
@@ -611,9 +611,9 @@ discard block |
||
| 611 | 611 | 'You will need to run this <info>curl</info> command from a remote terminal and paste its result: ' |
| 612 | 612 | ); |
| 613 | 613 | $output->writeln( |
| 614 | - ' curl -L "' . $frontal |
|
| 614 | + ' curl -L "'.$frontal |
|
| 615 | 615 | . '/.well-known/webfinger?resource=http://nextcloud.com/&test=' |
| 616 | - . $testToken . '"' |
|
| 616 | + . $testToken.'"' |
|
| 617 | 617 | ); |
| 618 | 618 | |
| 619 | 619 | $output->writeln('paste the result here: '); |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | |
| 648 | 648 | if ($pastedHref !== $href) { |
| 649 | 649 | $output->writeln( |
| 650 | - '<error>The returned data (' . $pastedHref . ') are not the one expected: </error>' |
|
| 650 | + '<error>The returned data ('.$pastedHref.') are not the one expected: </error>' |
|
| 651 | 651 | . $href |
| 652 | 652 | ); |
| 653 | 653 | continue; |
@@ -659,7 +659,7 @@ discard block |
||
| 659 | 659 | 'Next step, please run this <info>curl</info> command from a remote terminal and paste its result: ' |
| 660 | 660 | ); |
| 661 | 661 | $output->writeln( |
| 662 | - ' curl -L "' . $pastedHref . '?test=' . $testToken . '" -H "Accept: application/json"' |
|
| 662 | + ' curl -L "'.$pastedHref.'?test='.$testToken.'" -H "Accept: application/json"' |
|
| 663 | 663 | ); |
| 664 | 664 | |
| 665 | 665 | $output->writeln('paste the result here: '); |
@@ -675,9 +675,9 @@ discard block |
||
| 675 | 675 | || $appSignatory->getRoot() !== $pastedSignatory->g('root')) { |
| 676 | 676 | $output->writeln( |
| 677 | 677 | '<error>The returned data (' |
| 678 | - . $pastedSignatory->g('uid') . '/' . $pastedSignatory->g('root') |
|
| 678 | + . $pastedSignatory->g('uid').'/'.$pastedSignatory->g('root') |
|
| 679 | 679 | . ') are not the one expected: </error>' |
| 680 | - . $appSignatory->getUid(true) . '/' . $appSignatory->getRoot() |
|
| 680 | + . $appSignatory->getUid(true).'/'.$appSignatory->getRoot() |
|
| 681 | 681 | ); |
| 682 | 682 | continue; |
| 683 | 683 | } |
@@ -703,7 +703,7 @@ discard block |
||
| 703 | 703 | |
| 704 | 704 | $output->writeln(''); |
| 705 | 705 | $question = new ConfirmationQuestion( |
| 706 | - '- Do you want to save <info>' . $frontal |
|
| 706 | + '- Do you want to save <info>'.$frontal |
|
| 707 | 707 | . '</info> as your <info>frontal</info> address ? (y/N) ', |
| 708 | 708 | false, '/^(y|Y)/i' |
| 709 | 709 | ); |
@@ -719,7 +719,7 @@ discard block |
||
| 719 | 719 | $this->configService->setAppValue(ConfigService::FRONTAL_CLOUD_ID, $cloudId); |
| 720 | 720 | $this->configService->setAppValue(ConfigService::FRONTAL_CLOUD_PATH, $path); |
| 721 | 721 | |
| 722 | - $output->writeln('- Address <info>' . $frontal . '</info> is now used as <info>frontal</info>'); |
|
| 722 | + $output->writeln('- Address <info>'.$frontal.'</info> is now used as <info>frontal</info>'); |
|
| 723 | 723 | } |
| 724 | 724 | |
| 725 | 725 | /** |
@@ -744,7 +744,7 @@ discard block |
||
| 744 | 744 | $request->setDataSerialize(new SimpleDataStore(['empty' => 1])); |
| 745 | 745 | } |
| 746 | 746 | |
| 747 | - $output->write('- ' . $type . ' request on ' . $request->getCompleteUrl() . ': '); |
|
| 747 | + $output->write('- '.$type.' request on '.$request->getCompleteUrl().': '); |
|
| 748 | 748 | |
| 749 | 749 | try { |
| 750 | 750 | $this->doRequest($request); |
@@ -755,7 +755,7 @@ discard block |
||
| 755 | 755 | $color = 'info'; |
| 756 | 756 | } |
| 757 | 757 | |
| 758 | - $output->writeln('<' . $color . '>' . $result->getStatusCode() . '</' . $color . '>'); |
|
| 758 | + $output->writeln('<'.$color.'>'.$result->getStatusCode().'</'.$color.'>'); |
|
| 759 | 759 | if ($result->getStatusCode() === 200) { |
| 760 | 760 | return true; |
| 761 | 761 | } |
@@ -778,7 +778,7 @@ discard block |
||
| 778 | 778 | |
| 779 | 779 | $output->writeln(''); |
| 780 | 780 | $output->writeln( |
| 781 | - 'The address <info>' . $address . '</info> seems to reach your local Nextcloud.' |
|
| 781 | + 'The address <info>'.$address.'</info> seems to reach your local Nextcloud.' |
|
| 782 | 782 | ); |
| 783 | 783 | |
| 784 | 784 | $helper = $this->getHelper('question'); |
@@ -795,8 +795,8 @@ discard block |
||
| 795 | 795 | |
| 796 | 796 | $this->configService->setAppValue(ConfigService::FORCE_NC_BASE, $address); |
| 797 | 797 | $output->writeln( |
| 798 | - 'New configuration <info>' . Application::APP_ID . '.' . ConfigService::FORCE_NC_BASE . '=\'' |
|
| 799 | - . $address . '\'</info> stored in database' |
|
| 798 | + 'New configuration <info>'.Application::APP_ID.'.'.ConfigService::FORCE_NC_BASE.'=\'' |
|
| 799 | + . $address.'\'</info> stored in database' |
|
| 800 | 800 | ); |
| 801 | 801 | } |
| 802 | 802 | |
@@ -823,7 +823,7 @@ discard block |
||
| 823 | 823 | $path = rtrim($path, '/'); |
| 824 | 824 | |
| 825 | 825 | if (!is_null($cloudIdPort)) { |
| 826 | - $cloudId = $cloudId . ':' . $cloudIdPort; |
|
| 826 | + $cloudId = $cloudId.':'.$cloudIdPort; |
|
| 827 | 827 | } |
| 828 | 828 | |
| 829 | 829 | return [$scheme, $cloudId, $path]; |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | 'version' => $this->configService->getAppValue('installed_version'), |
| 88 | 88 | 'api' => Application::APP_API |
| 89 | 89 | ]; |
| 90 | - } catch (UnknownInterfaceException|SignatoryException $e) { |
|
| 90 | + } catch (UnknownInterfaceException | SignatoryException $e) { |
|
| 91 | 91 | return $response; |
| 92 | 92 | } |
| 93 | 93 | |