@@ -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); |
@@ -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 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | } |
| 146 | 146 | } catch (Exception $e) { |
| 147 | 147 | $this->miscService->log( |
| 148 | - get_class($e) . ' on new event: ' . $e->getMessage() . ' - ' . json_encode($event), 1 |
|
| 148 | + get_class($e).' on new event: '.$e->getMessage().' - '.json_encode($event), 1 |
|
| 149 | 149 | ); |
| 150 | 150 | throw $e; |
| 151 | 151 | } |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | * @throws RequestResultNotJsonException |
| 216 | 216 | * @throws GlobalScaleEventException |
| 217 | 217 | */ |
| 218 | - public function confirmEvent(GSEvent &$event): void { |
|
| 218 | + public function confirmEvent(GSEvent & $event): void { |
|
| 219 | 219 | $this->signEvent($event); |
| 220 | 220 | |
| 221 | 221 | $circle = $event->getDeprecatedCircle(); |
@@ -229,13 +229,13 @@ discard block |
||
| 229 | 229 | $request->setDataSerialize($event); |
| 230 | 230 | |
| 231 | 231 | $result = $this->retrieveJson($request); |
| 232 | - $this->miscService->log('result ' . json_encode($result), 0); |
|
| 232 | + $this->miscService->log('result '.json_encode($result), 0); |
|
| 233 | 233 | if ($this->getInt('status', $result) === 0) { |
| 234 | 234 | throw new GlobalScaleEventException($this->get('error', $result)); |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | $updatedData = $this->getArray('event', $result); |
| 238 | - $this->miscService->log('updatedEvent: ' . json_encode($updatedData), 0); |
|
| 238 | + $this->miscService->log('updatedEvent: '.json_encode($updatedData), 0); |
|
| 239 | 239 | if (!empty($updatedData)) { |
| 240 | 240 | $updated = new GSEvent(); |
| 241 | 241 | try { |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | public function getCachedRemoteInstance(string $instance): RemoteInstance { |
| 331 | 331 | $remoteInstance = $this->remoteRequest->getFromInstance($instance); |
| 332 | 332 | if ($remoteInstance->getType() === RemoteInstance::TYPE_UNKNOWN) { |
| 333 | - throw new UnknownRemoteException($instance . ' is set as \'unknown\' in database'); |
|
| 333 | + throw new UnknownRemoteException($instance.' is set as \'unknown\' in database'); |
|
| 334 | 334 | } |
| 335 | 335 | |
| 336 | 336 | return $remoteInstance; |
@@ -571,7 +571,7 @@ discard block |
||
| 571 | 571 | * @throws RemoteNotFoundException |
| 572 | 572 | * @throws RemoteUidException |
| 573 | 573 | */ |
| 574 | - public function confirmValidRemote(RemoteInstance $remote, ?RemoteInstance &$stored = null): void { |
|
| 574 | + public function confirmValidRemote(RemoteInstance $remote, ?RemoteInstance & $stored = null): void { |
|
| 575 | 575 | try { |
| 576 | 576 | $stored = $this->remoteRequest->getFromHref($remote->getId()); |
| 577 | 577 | } catch (RemoteNotFoundException $e) { |
@@ -61,9 +61,9 @@ discard block |
||
| 61 | 61 | |
| 62 | 62 | public static $DELAY = |
| 63 | 63 | [ |
| 64 | - 1 => 60, // every minute |
|
| 65 | - 2 => 300, // every 5 minutes |
|
| 66 | - 3 => 3600, // every hour |
|
| 64 | + 1 => 60, // every minute |
|
| 65 | + 2 => 300, // every 5 minutes |
|
| 66 | + 3 => 3600, // every hour |
|
| 67 | 67 | 4 => 75400, // every day |
| 68 | 68 | 5 => 432000 // evey week |
| 69 | 69 | ]; |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | $this->federatedUserService->bypassCurrentUserCondition(true); |
| 179 | 179 | |
| 180 | 180 | $this->lockMaintenanceRun(); |
| 181 | - $this->debug('running maintenance (' . $level . ')'); |
|
| 181 | + $this->debug('running maintenance ('.$level.')'); |
|
| 182 | 182 | |
| 183 | 183 | switch ($level) { |
| 184 | 184 | case 1: |
@@ -349,14 +349,14 @@ discard block |
||
| 349 | 349 | ->includeSystemCircles(); |
| 350 | 350 | |
| 351 | 351 | $circles = array_map( |
| 352 | - function (Circle $circle) { |
|
| 352 | + function(Circle $circle) { |
|
| 353 | 353 | return $circle->getSingleId(); |
| 354 | 354 | }, $this->circleRequest->getCircles(null, $probe) |
| 355 | 355 | ); |
| 356 | 356 | |
| 357 | 357 | $shares = array_unique( |
| 358 | 358 | array_map( |
| 359 | - function (ShareWrapper $share) { |
|
| 359 | + function(ShareWrapper $share) { |
|
| 360 | 360 | return $share->getSharedWith(); |
| 361 | 361 | }, $this->shareWrapperRequest->getShares() |
| 362 | 362 | ) |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | */ |
| 502 | 502 | private function output(string $message): void { |
| 503 | 503 | if (!is_null($this->output)) { |
| 504 | - $this->output->writeln('- ' . $message); |
|
| 504 | + $this->output->writeln('- '.$message); |
|
| 505 | 505 | } |
| 506 | 506 | } |
| 507 | 507 | } |