@@ -198,10 +198,10 @@ discard block |
||
198 | 198 | $qb->leftJoin( |
199 | 199 | CoreQueryBuilder::REMOTE, self::TABLE_MEMBER, $aliasMember, |
200 | 200 | $expr->andX( |
201 | - $expr->eq($aliasMember . '.circle_id', $qb->createNamedParameter($circle->getSingleId())), |
|
202 | - $expr->eq($aliasMember . '.instance', CoreQueryBuilder::REMOTE . '.instance'), |
|
201 | + $expr->eq($aliasMember.'.circle_id', $qb->createNamedParameter($circle->getSingleId())), |
|
202 | + $expr->eq($aliasMember.'.instance', CoreQueryBuilder::REMOTE.'.instance'), |
|
203 | 203 | $expr->gte( |
204 | - $aliasMember . '.level', |
|
204 | + $aliasMember.'.level', |
|
205 | 205 | $qb->createNamedParameter(Member::LEVEL_MEMBER, IQueryBuilder::PARAM_INT) |
206 | 206 | ) |
207 | 207 | ) |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | |
210 | 210 | $external = $expr->andX(); |
211 | 211 | $external->add($qb->exprLimit('type', RemoteInstance::TYPE_EXTERNAL, '', false)); |
212 | - $external->add($expr->isNotNull($aliasMember . '.instance')); |
|
212 | + $external->add($expr->isNotNull($aliasMember.'.instance')); |
|
213 | 213 | $orX->add($external); |
214 | 214 | } |
215 | 215 |
@@ -86,7 +86,7 @@ |
||
86 | 86 | self::$tables[self::TABLE_MEMBER], |
87 | 87 | CoreQueryBuilder::MEMBER |
88 | 88 | ) |
89 | - ->orderBy(CoreQueryBuilder::MEMBER . '.joined'); |
|
89 | + ->orderBy(CoreQueryBuilder::MEMBER.'.joined'); |
|
90 | 90 | |
91 | 91 | if ($getBasedOn) { |
92 | 92 | $qb->leftJoinBasedOn(CoreQueryBuilder::MEMBER, $initiator); |
@@ -187,11 +187,11 @@ discard block |
||
187 | 187 | $this->federatedUserService->commandLineInitiator($initiator, $initiatorType, $circleId, true); |
188 | 188 | $circle = $this->circleService->getCircle($circleId); |
189 | 189 | |
190 | - $output->writeln('<info>Name</info>: ' . $circle->getName()); |
|
190 | + $output->writeln('<info>Name</info>: '.$circle->getName()); |
|
191 | 191 | $owner = $circle->getOwner(); |
192 | - $output->writeln('<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance()); |
|
192 | + $output->writeln('<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance()); |
|
193 | 193 | $type = implode(", ", Circle::getCircleFlags($circle, Circle::FLAGS_LONG)); |
194 | - $output->writeln('<info>Config</info>: ' . $type); |
|
194 | + $output->writeln('<info>Config</info>: '.$type); |
|
195 | 195 | $output->writeln(' '); |
196 | 196 | |
197 | 197 | $tree = new TreeNode(null, new SimpleDataStore(['circle' => $circle])); |
@@ -256,8 +256,7 @@ discard block |
||
256 | 256 | $member, |
257 | 257 | $this->input->getOption('display-name') |
258 | 258 | ), |
259 | - ($level > 0) ? Member::$DEF_LEVEL[$level] : |
|
260 | - '(' . strtolower($member->getStatus()) . ')', |
|
259 | + ($level > 0) ? Member::$DEF_LEVEL[$level] : '('.strtolower($member->getStatus()).')', |
|
261 | 260 | ($member->hasInvitedBy()) ? $this->configService->displayFederatedUser( |
262 | 261 | $member->getInvitedBy(), |
263 | 262 | $this->input->getOption('display-name') |
@@ -423,14 +422,14 @@ discard block |
||
423 | 422 | $member = $data->gObj('member', Member::class); |
424 | 423 | |
425 | 424 | if ($lineNumber === 1) { |
426 | - $line .= '<info>' . $member->getSingleId() . '</info>'; |
|
425 | + $line .= '<info>'.$member->getSingleId().'</info>'; |
|
427 | 426 | if (!$this->configService->isLocalInstance($member->getInstance())) { |
428 | - $line .= '@' . $member->getInstance(); |
|
427 | + $line .= '@'.$member->getInstance(); |
|
429 | 428 | } |
430 | - $line .= ' (' . Member::$DEF_LEVEL[$member->getLevel()] . ')'; |
|
429 | + $line .= ' ('.Member::$DEF_LEVEL[$member->getLevel()].')'; |
|
431 | 430 | |
432 | - $line .= ' <info>MemberId</info>: ' . $member->getId(); |
|
433 | - $line .= ' <info>Name</info>: ' . $this->configService->displayFederatedUser( |
|
431 | + $line .= ' <info>MemberId</info>: '.$member->getId(); |
|
432 | + $line .= ' <info>Name</info>: '.$this->configService->displayFederatedUser( |
|
434 | 433 | $member, |
435 | 434 | $this->input->getOption('display-name') |
436 | 435 | ); |
@@ -438,7 +437,7 @@ discard block |
||
438 | 437 | $line .= ' <info>Source</info>: ' |
439 | 438 | . Circle::$DEF_SOURCE[$member->getBasedOn()->getSource()]; |
440 | 439 | } else { |
441 | - $line .= ' <info>Type</info>: ' . Member::$TYPE[$member->getUserType()]; |
|
440 | + $line .= ' <info>Type</info>: '.Member::$TYPE[$member->getUserType()]; |
|
442 | 441 | } |
443 | 442 | } |
444 | 443 | |
@@ -451,15 +450,15 @@ discard block |
||
451 | 450 | return $line; |
452 | 451 | } |
453 | 452 | $owner = $circle->getOwner(); |
454 | - $line .= '<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance(); |
|
453 | + $line .= '<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance(); |
|
455 | 454 | $type = implode(", ", Circle::getCircleFlags($circle, Circle::FLAGS_LONG)); |
456 | - $line .= ($type === '') ? '' : ' <info>Config</info>: ' . $type; |
|
455 | + $line .= ($type === '') ? '' : ' <info>Config</info>: '.$type; |
|
457 | 456 | } |
458 | 457 | } else { |
459 | 458 | if ($lineNumber === 1 && !is_null($circle)) { |
460 | - $line .= '<info>' . $circle->getSingleId() . '</info>'; |
|
459 | + $line .= '<info>'.$circle->getSingleId().'</info>'; |
|
461 | 460 | if (!$this->configService->isLocalInstance($circle->getInstance())) { |
462 | - $line .= '@' . $circle->getInstance(); |
|
461 | + $line .= '@'.$circle->getInstance(); |
|
463 | 462 | } |
464 | 463 | } |
465 | 464 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | public function getInstance(): string { |
258 | 258 | $instance = $this->getHost(); |
259 | 259 | if ($this->getPort() > 0) { |
260 | - $instance .= ':' . $this->getPort(); |
|
260 | + $instance .= ':'.$this->getPort(); |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | return $instance; |
@@ -281,7 +281,7 @@ discard block |
||
281 | 281 | if ($protocol === null) { |
282 | 282 | if (strpos($url, '/') > -1) { |
283 | 283 | [$address, $baseUrl] = explode('/', $url, 2); |
284 | - $this->setBaseUrl('/' . $baseUrl); |
|
284 | + $this->setBaseUrl('/'.$baseUrl); |
|
285 | 285 | } else { |
286 | 286 | $address = $url; |
287 | 287 | } |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | continue; |
392 | 392 | } |
393 | 393 | |
394 | - $url = str_replace(':' . $k, $this->data[$k], $url); |
|
394 | + $url = str_replace(':'.$k, $this->data[$k], $url); |
|
395 | 395 | } |
396 | 396 | |
397 | 397 | return $url; |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | continue; |
409 | 409 | } |
410 | 410 | |
411 | - $url = str_replace(':' . $k, $this->params[$k], $url); |
|
411 | + $url = str_replace(':'.$k, $this->params[$k], $url); |
|
412 | 412 | } |
413 | 413 | |
414 | 414 | return $url; |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | * @return string |
420 | 420 | */ |
421 | 421 | public function getPath(): string { |
422 | - return $this->baseUrl . $this->url; |
|
422 | + return $this->baseUrl.$this->url; |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | |
@@ -436,9 +436,9 @@ discard block |
||
436 | 436 | * @return string |
437 | 437 | */ |
438 | 438 | public function getCompleteUrl(): string { |
439 | - $port = ($this->getPort() > 0) ? ':' . $this->getPort() : ''; |
|
439 | + $port = ($this->getPort() > 0) ? ':'.$this->getPort() : ''; |
|
440 | 440 | |
441 | - return $this->getUsedProtocol() . '://' . $this->getHost() . $port . $this->getParametersUrl(); |
|
441 | + return $this->getUsedProtocol().'://'.$this->getHost().$port.$this->getParametersUrl(); |
|
442 | 442 | } |
443 | 443 | |
444 | 444 | |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | public function addHeader($key, $value): Request { |
454 | 454 | $header = $this->get($key, $this->headers); |
455 | 455 | if ($header !== '') { |
456 | - $header .= ', ' . $value; |
|
456 | + $header .= ', '.$value; |
|
457 | 457 | } else { |
458 | 458 | $header = $value; |
459 | 459 | } |
@@ -683,11 +683,11 @@ discard block |
||
683 | 683 | |
684 | 684 | switch ($this->getQueryStringType()) { |
685 | 685 | case self::QS_VAR_ARRAY: |
686 | - return '?' . http_build_query($this->getParams()); |
|
686 | + return '?'.http_build_query($this->getParams()); |
|
687 | 687 | |
688 | 688 | case self::QS_VAR_DUPLICATE: |
689 | 689 | default: |
690 | - return '?' . preg_replace( |
|
690 | + return '?'.preg_replace( |
|
691 | 691 | '/%5B(?:[0-9]|[1-9][0-9]+)%5D=/', '=', http_build_query($this->getParams()) |
692 | 692 | ); |
693 | 693 | } |
@@ -169,10 +169,10 @@ |
||
169 | 169 | return $client->delete($request->getCompleteUrl(), $request->getClientOptions()); |
170 | 170 | case Request::TYPE_GET: |
171 | 171 | return $client->get( |
172 | - $request->getCompleteUrl() . $request->getQueryString(), $request->getClientOptions() |
|
172 | + $request->getCompleteUrl().$request->getQueryString(), $request->getClientOptions() |
|
173 | 173 | ); |
174 | 174 | default: |
175 | - throw new Exception('unknown request type ' . json_encode($request)); |
|
175 | + throw new Exception('unknown request type '.json_encode($request)); |
|
176 | 176 | } |
177 | 177 | } |
178 | 178 | } |
@@ -177,7 +177,7 @@ |
||
177 | 177 | // It seems that AccountManager use deprecated dispatcher, let's use a deprecated listener |
178 | 178 | $dispatcher = OC::$server->getEventDispatcher(); |
179 | 179 | $dispatcher->addListener( |
180 | - 'OC\AccountManager::userUpdated', function (GenericEvent $event) { |
|
180 | + 'OC\AccountManager::userUpdated', function(GenericEvent $event) { |
|
181 | 181 | /** @var IUser $user */ |
182 | 182 | $user = $event->getSubject(); |
183 | 183 | /** @var DeprecatedListener $deprecatedListener */ |
@@ -324,8 +324,8 @@ |
||
324 | 324 | int $nodeId, |
325 | 325 | string $probeSum |
326 | 326 | ): string { |
327 | - return $federatedUser->getSingleId() . '#' |
|
328 | - . $nodeId . '#' |
|
327 | + return $federatedUser->getSingleId().'#' |
|
328 | + . $nodeId.'#' |
|
329 | 329 | . $probeSum; |
330 | 330 | } |
331 | 331 | } |
@@ -92,27 +92,27 @@ discard block |
||
92 | 92 | |
93 | 93 | |
94 | 94 | // specific value |
95 | - public const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default. |
|
96 | - public const CFG_SINGLE = 1; // Circle with only one single member. |
|
97 | - public const CFG_PERSONAL = 2; // Personal circle, only the owner can see it. |
|
95 | + public const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default. |
|
96 | + public const CFG_SINGLE = 1; // Circle with only one single member. |
|
97 | + public const CFG_PERSONAL = 2; // Personal circle, only the owner can see it. |
|
98 | 98 | |
99 | 99 | // bitwise |
100 | - public const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited |
|
101 | - public const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it |
|
102 | - public const CFG_OPEN = 16; // Circle is open, people can join |
|
103 | - public const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted |
|
104 | - public const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator |
|
105 | - public const CFG_FRIEND = 128; // Members of the circle can invite their friends |
|
106 | - public const CFG_PROTECTED = 256; // Password protected to join/request |
|
107 | - public const CFG_NO_OWNER = 512; // no owner, only members |
|
108 | - public const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity |
|
109 | - public const CFG_BACKEND = 2048; // Fully hidden, only backend Circles |
|
110 | - public const CFG_LOCAL = 4096; // Local even on GlobalScale |
|
111 | - public const CFG_ROOT = 8192; // Circle cannot be inside another Circle |
|
112 | - public const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle |
|
113 | - public const CFG_FEDERATED = 32768; // Federated |
|
114 | - public const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle |
|
115 | - public const CFG_APP = 131072; // Some features are not available to the OCS API (ie. destroying Circle) |
|
100 | + public const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited |
|
101 | + public const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it |
|
102 | + public const CFG_OPEN = 16; // Circle is open, people can join |
|
103 | + public const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted |
|
104 | + public const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator |
|
105 | + public const CFG_FRIEND = 128; // Members of the circle can invite their friends |
|
106 | + public const CFG_PROTECTED = 256; // Password protected to join/request |
|
107 | + public const CFG_NO_OWNER = 512; // no owner, only members |
|
108 | + public const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity |
|
109 | + public const CFG_BACKEND = 2048; // Fully hidden, only backend Circles |
|
110 | + public const CFG_LOCAL = 4096; // Local even on GlobalScale |
|
111 | + public const CFG_ROOT = 8192; // Circle cannot be inside another Circle |
|
112 | + public const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle |
|
113 | + public const CFG_FEDERATED = 32768; // Federated |
|
114 | + public const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle |
|
115 | + public const CFG_APP = 131072; // Some features are not available to the OCS API (ie. destroying Circle) |
|
116 | 116 | public static $DEF_CFG_MAX = 262143; |
117 | 117 | |
118 | 118 | |
@@ -481,7 +481,7 @@ discard block |
||
481 | 481 | */ |
482 | 482 | public function addInheritedMembers(array $members): self { |
483 | 483 | $knownIds = array_map( |
484 | - function (Member $member): string { |
|
484 | + function(Member $member): string { |
|
485 | 485 | return $member->getId(); |
486 | 486 | }, $this->inheritedMembers |
487 | 487 | ); |
@@ -895,23 +895,23 @@ discard block |
||
895 | 895 | * @throws CircleNotFoundException |
896 | 896 | */ |
897 | 897 | public function importFromDatabase(array $data, string $prefix = ''): IQueryRow { |
898 | - if ($this->get($prefix . 'unique_id', $data) === '') { |
|
898 | + if ($this->get($prefix.'unique_id', $data) === '') { |
|
899 | 899 | throw new CircleNotFoundException(); |
900 | 900 | } |
901 | 901 | |
902 | - $this->setSingleId($this->get($prefix . 'unique_id', $data)) |
|
903 | - ->setName($this->get($prefix . 'name', $data)) |
|
904 | - ->setDisplayName($this->get($prefix . 'display_name', $data)) |
|
905 | - ->setSanitizedName($this->get($prefix . 'sanitized_name', $data)) |
|
906 | - ->setConfig($this->getInt($prefix . 'config', $data)) |
|
907 | - ->setSource($this->getInt($prefix . 'source', $data)) |
|
908 | - ->setInstance($this->get($prefix . 'instance', $data)) |
|
909 | - ->setSettings($this->getArray($prefix . 'settings', $data)) |
|
910 | - ->setContactAddressBook($this->getInt($prefix . 'contact_addressbook', $data)) |
|
911 | - ->setContactGroupName($this->get($prefix . 'contact_groupname', $data)) |
|
912 | - ->setDescription($this->get($prefix . 'description', $data)); |
|
913 | - |
|
914 | - $creation = $this->get($prefix . 'creation', $data); |
|
902 | + $this->setSingleId($this->get($prefix.'unique_id', $data)) |
|
903 | + ->setName($this->get($prefix.'name', $data)) |
|
904 | + ->setDisplayName($this->get($prefix.'display_name', $data)) |
|
905 | + ->setSanitizedName($this->get($prefix.'sanitized_name', $data)) |
|
906 | + ->setConfig($this->getInt($prefix.'config', $data)) |
|
907 | + ->setSource($this->getInt($prefix.'source', $data)) |
|
908 | + ->setInstance($this->get($prefix.'instance', $data)) |
|
909 | + ->setSettings($this->getArray($prefix.'settings', $data)) |
|
910 | + ->setContactAddressBook($this->getInt($prefix.'contact_addressbook', $data)) |
|
911 | + ->setContactGroupName($this->get($prefix.'contact_groupname', $data)) |
|
912 | + ->setDescription($this->get($prefix.'description', $data)); |
|
913 | + |
|
914 | + $creation = $this->get($prefix.'creation', $data); |
|
915 | 915 | $this->setCreation(DateTime::createFromFormat('Y-m-d H:i:s', $creation)->getTimestamp()); |
916 | 916 | |
917 | 917 | $this->setPopulation($this->getInt('population', $this->getSettings())); |
@@ -257,9 +257,9 @@ |
||
257 | 257 | Circle::$DEF_SOURCE[$circle->getSource()], |
258 | 258 | $this->cut($displayName ? $owner->getDisplayName() : $owner->getUserId(), 40), |
259 | 259 | $this->configService->displayInstance($owner->getInstance()), |
260 | - $circle->getPopulation() . '/' |
|
260 | + $circle->getPopulation().'/' |
|
261 | 261 | . $this->getInt('members_limit', $circle->getSettings(), -1) |
262 | - . ' (' . $circle->getPopulationInherited() . ')' |
|
262 | + . ' ('.$circle->getPopulationInherited().')' |
|
263 | 263 | ] |
264 | 264 | ); |
265 | 265 | } |