@@ -101,7 +101,7 @@ |
||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | if (!$ignoreApi && $this->isApiVersion(TeamAPI::V1)) { |
| 104 | - return []; // TODO: old API compat |
|
| 104 | + return []; // TODO: old API compat |
|
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | return [ |
@@ -23,9 +23,9 @@ |
||
| 23 | 23 | private ?TeamEntityManager $teamEntityManager = null; |
| 24 | 24 | private ?TeamMemberManager $teamMemberManager = null; |
| 25 | 25 | |
| 26 | - protected null|TeamSession|TeamEntity $lazyLoadingEntity = null; |
|
| 26 | + protected null | TeamSession | TeamEntity $lazyLoadingEntity = null; |
|
| 27 | 27 | |
| 28 | - public function enableLazyLoading(TeamSession|TeamEntity $entity): void { |
|
| 28 | + public function enableLazyLoading(TeamSession | TeamEntity $entity): void { |
|
| 29 | 29 | $this->lazyLoadingEntity = $entity; |
| 30 | 30 | } |
| 31 | 31 | |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | if ($this->isApiVersion(TeamAPI::V1)) { |
| 86 | - return []; // TODO: old API compat |
|
| 86 | + return []; // TODO: old API compat |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | return [ |
@@ -84,13 +84,13 @@ |
||
| 84 | 84 | return array_filter($this->metadata, static fn(string $k): bool => !str_starts_with($k, '_'), ARRAY_FILTER_USE_KEY); |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | - public function setMetaValue(string $key, string|int|float|bool|array $value): void { |
|
| 87 | + public function setMetaValue(string $key, string | int | float | bool | array $value): void { |
|
| 88 | 88 | $metadata = $this->metadata; |
| 89 | 89 | $metadata[$key] = $value; |
| 90 | 90 | $this->setter('metadata', [$metadata]); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | - public function getMembers(null|TeamSession|TeamEntity $initiator = null): ?array { |
|
| 93 | + public function getMembers(null | TeamSession | TeamEntity $initiator = null): ?array { |
|
| 94 | 94 | $initiator ??= $this->lazyLoadingEntity; |
| 95 | 95 | if ($initiator === null) { |
| 96 | 96 | return null; |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | $this->setMetaValue('_invitedBy', $invitedBy->jsonSerialize(true)); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - public function setMetaValue(string $key, string|int|float|bool|array $value): void { |
|
| 107 | + public function setMetaValue(string $key, string | int | float | bool | array $value): void { |
|
| 108 | 108 | $metadata = $this->metadata; |
| 109 | 109 | $metadata[$key] = $value; |
| 110 | 110 | $this->setter('metadata', [$metadata]); |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | if ($this->isApiVersion(TeamAPI::V1)) { |
| 149 | - return []; // TODO: old API compat |
|
| 149 | + return []; // TODO: old API compat |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | return [ |
@@ -54,12 +54,12 @@ discard block |
||
| 54 | 54 | ) { |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - public function getTeamMember(TeamSession|TeamEntity $initiator, string $teamSingleId, string $memberSingleId): TeamMember { |
|
| 57 | + public function getTeamMember(TeamSession | TeamEntity $initiator, string $teamSingleId, string $memberSingleId): TeamMember { |
|
| 58 | 58 | // return $this->teamMemberMapper->getByTeamAndMember($teamSingleId, $memberSingleId); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | |
| 62 | - public function addMember(TeamSession|TeamEntity $initiator, string $teamSingleId, string $singleId): TeamMember { |
|
| 62 | + public function addMember(TeamSession | TeamEntity $initiator, string $teamSingleId, string $singleId): TeamMember { |
|
| 63 | 63 | try { |
| 64 | 64 | $initiatorMembership = $this->getInitiatorMembership($initiator, $teamSingleId); |
| 65 | 65 | if ($initiatorMembership->getLevel() < TeamMemberLevel::MODERATOR->value) { |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | /** |
| 82 | 82 | * @return TeamMember[] |
| 83 | 83 | */ |
| 84 | - public function getMembersFromTeam(TeamSession|TeamEntity $initiator, string $teamSingleId): array { |
|
| 84 | + public function getMembersFromTeam(TeamSession | TeamEntity $initiator, string $teamSingleId): array { |
|
| 85 | 85 | return $this->teamMemberMapper->getTeamMembers( |
| 86 | 86 | $this->filterInitiator($initiator), |
| 87 | 87 | $teamSingleId |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | /** |
| 92 | 92 | * @return TeamMember[] |
| 93 | 93 | */ |
| 94 | - public function getTeamsContainingEntity(TeamSession|TeamEntity $initiator, $singleId) { |
|
| 94 | + public function getTeamsContainingEntity(TeamSession | TeamEntity $initiator, $singleId) { |
|
| 95 | 95 | return $this->teamMemberMapper->getEntityTeams( |
| 96 | 96 | $this->filterInitiator($initiator), |
| 97 | 97 | $singleId |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | ) { |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - final protected function extractTeamEntity(TeamSession|TeamEntity $initiator): TeamEntity { |
|
| 27 | + final protected function extractTeamEntity(TeamSession | TeamEntity $initiator): TeamEntity { |
|
| 28 | 28 | if ($initiator instanceof TeamSession) { |
| 29 | 29 | return $initiator->getEntity(); |
| 30 | 30 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | /** |
| 36 | 36 | * returns NULL if initiator have super permissions (occ, super_admin) |
| 37 | 37 | */ |
| 38 | - final protected function filterInitiator(TeamSession|TeamEntity $initiator): ?TeamEntity { |
|
| 38 | + final protected function filterInitiator(TeamSession | TeamEntity $initiator): ?TeamEntity { |
|
| 39 | 39 | $initiator = $this->extractTeamEntity($initiator); |
| 40 | 40 | |
| 41 | 41 | if (in_array($initiator->getTeamEntityType(), [ |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * @throws TeamEntityOverwritePermissionException |
| 53 | 53 | * @throws TeamMembershipNotFoundException |
| 54 | 54 | */ |
| 55 | - final protected function getInitiatorMembership(TeamEntity|TeamSession $initiator, string $teamSingleId): TeamMembership { |
|
| 55 | + final protected function getInitiatorMembership(TeamEntity | TeamSession $initiator, string $teamSingleId): TeamMembership { |
|
| 56 | 56 | $initiatorEntity = $this->filterInitiator($initiator); |
| 57 | 57 | if ($initiatorEntity === null) { |
| 58 | 58 | throw new TeamEntityOverwritePermissionException('initiator is above everyone, bypassing membership check'); |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | $known = $this->teamMembershipManager->getMemberships($singleId); |
| 188 | 188 | |
| 189 | 189 | $indexed = []; |
| 190 | - foreach($known as $entry) { |
|
| 190 | + foreach ($known as $entry) { |
|
| 191 | 191 | $indexed[$entry->getTeamSingleId()] = $entry; |
| 192 | 192 | } |
| 193 | 193 | |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | * @return array |
| 221 | 221 | * @throws RequestBuilderException |
| 222 | 222 | */ |
| 223 | - private function getChildrenMembers( string $id, array &$knownIds = []): array { |
|
| 223 | + private function getChildrenMembers(string $id, array &$knownIds = []): array { |
|
| 224 | 224 | $singleIds = array_map( |
| 225 | 225 | function(Member $item): string { |
| 226 | 226 | return $item->getSingleId(); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | // |
| 63 | 63 | $entityOperation = $this->teamSession->performTeamEntityOperation(); |
| 64 | - $test3 = $entityOperation->getFromLocalUser('test3'); |
|
| 64 | + $test3 = $entityOperation->getFromLocalUser('test3'); |
|
| 65 | 65 | |
| 66 | 66 | $entityOperation = $this->teamSession->performTeamEntityOperation(); |
| 67 | 67 | $team1 = $this->teamSession->performTeamOperation()->createTeam( |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | ); |
| 98 | 98 | |
| 99 | 99 | |
| 100 | - echo json_encode($this->teamSession->performTeamOperation()->getTeam($team2->getSingleId()), JSON_PRETTY_PRINT) . "\n"; |
|
| 100 | + echo json_encode($this->teamSession->performTeamOperation()->getTeam($team2->getSingleId()), JSON_PRETTY_PRINT)."\n"; |
|
| 101 | 101 | $session = $this->teamSession->sessionAsSuperAdmin(); |
| 102 | 102 | $membershipOperation = $session->performTeamMembershipOperation(); |
| 103 | 103 | $membershipOperation->syncTeamMemberships($team1->getSingleId()); |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | } catch (FederatedItemException $e) { |
| 125 | 125 | if ($input->getOption('status-code')) { |
| 126 | 126 | throw new FederatedItemException( |
| 127 | - ' [' . get_class($e) . ', ' . $e->getStatus() . ']' . "\n" . $e->getMessage() |
|
| 127 | + ' ['.get_class($e).', '.$e->getStatus().']'."\n".$e->getMessage() |
|
| 128 | 128 | ); |
| 129 | 129 | } |
| 130 | 130 | |
@@ -136,9 +136,9 @@ discard block |
||
| 136 | 136 | } elseif (strtolower($input->getOption('output')) !== 'none') { |
| 137 | 137 | /** @var Circle $circle */ |
| 138 | 138 | $circle = $this->deserialize($outcome, Circle::class); |
| 139 | - $output->writeln('Id: <info>' . $circle->getSingleId() . '</info>'); |
|
| 140 | - $output->writeln('Name: <info>' . $circle->getDisplayName() . '</info>'); |
|
| 141 | - $output->writeln('Owner: <info>' . $circle->getOwner()->getDisplayName() . '</info>'); |
|
| 139 | + $output->writeln('Id: <info>'.$circle->getSingleId().'</info>'); |
|
| 140 | + $output->writeln('Name: <info>'.$circle->getDisplayName().'</info>'); |
|
| 141 | + $output->writeln('Owner: <info>'.$circle->getOwner()->getDisplayName().'</info>'); |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | return 0; |