@@ -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 | } |
@@ -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; |
@@ -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 | } |
@@ -91,7 +91,7 @@ |
||
| 91 | 91 | RequestResultNotJsonException $e |
| 92 | 92 | ) { |
| 93 | 93 | $this->miscService->log( |
| 94 | - 'Issue while search users from lookup: ' . get_class($e) . ' ' . $e->getMessage() |
|
| 94 | + 'Issue while search users from lookup: '.get_class($e).' '.$e->getMessage() |
|
| 95 | 95 | ); |
| 96 | 96 | |
| 97 | 97 | return []; |
@@ -245,7 +245,7 @@ discard block |
||
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | $expr = $qb->expr(); |
| 248 | - $pf = '' . $this->default_select_alias . '.'; |
|
| 248 | + $pf = ''.$this->default_select_alias.'.'; |
|
| 249 | 249 | |
| 250 | 250 | /** @noinspection PhpMethodParametersCountMismatchInspection */ |
| 251 | 251 | $qb->selectAlias('u.user_id', 'viewer_userid') |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | ->leftJoin( |
| 260 | 260 | $this->default_select_alias, DeprecatedRequestBuilder::TABLE_MEMBERS, 'u', |
| 261 | 261 | $expr->andX( |
| 262 | - $expr->eq('u.circle_id', $pf . 'unique_id'), |
|
| 262 | + $expr->eq('u.circle_id', $pf.'unique_id'), |
|
| 263 | 263 | $expr->eq('u.user_id', $qb->createNamedParameter($userId)), |
| 264 | 264 | $expr->eq('u.instance', $qb->createNamedParameter($instanceId)), |
| 265 | 265 | $expr->eq('u.user_type', $qb->createNamedParameter($type)) |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | $expr = $qb->expr(); |
| 283 | - $pf = $this->default_select_alias . '.'; |
|
| 283 | + $pf = $this->default_select_alias.'.'; |
|
| 284 | 284 | |
| 285 | 285 | /** @noinspection PhpMethodParametersCountMismatchInspection */ |
| 286 | 286 | $qb->selectAlias('o.user_id', 'owner_userid') |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | ->leftJoin( |
| 294 | 294 | $this->default_select_alias, DeprecatedRequestBuilder::TABLE_MEMBERS, 'o', |
| 295 | 295 | $expr->andX( |
| 296 | - $expr->eq('o.circle_id', $pf . 'unique_id'), |
|
| 296 | + $expr->eq('o.circle_id', $pf.'unique_id'), |
|
| 297 | 297 | $expr->eq('o.level', $qb->createNamedParameter(DeprecatedMember::LEVEL_OWNER)), |
| 298 | 298 | $expr->eq('o.user_type', $qb->createNamedParameter(DeprecatedMember::TYPE_USER)) |
| 299 | 299 | ) |
@@ -346,8 +346,8 @@ discard block |
||
| 346 | 346 | $expr = $qb->expr(); |
| 347 | 347 | |
| 348 | 348 | if ($pf === '') { |
| 349 | - $p = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias . '.' : ''; |
|
| 350 | - $qb->andWhere($expr->gte($p . 'level', $qb->createNamedParameter($level))); |
|
| 349 | + $p = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias.'.' : ''; |
|
| 350 | + $qb->andWhere($expr->gte($p.'level', $qb->createNamedParameter($level))); |
|
| 351 | 351 | |
| 352 | 352 | return; |
| 353 | 353 | } |
@@ -376,7 +376,7 @@ discard block |
||
| 376 | 376 | if ($p === 'g' && !$this->leftJoinedNCGroupAndUser) { |
| 377 | 377 | continue; |
| 378 | 378 | } |
| 379 | - $orX->add($expr->gte($p . '.level', $qb->createNamedParameter($level))); |
|
| 379 | + $orX->add($expr->gte($p.'.level', $qb->createNamedParameter($level))); |
|
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | return $orX; |
@@ -391,12 +391,12 @@ discard block |
||
| 391 | 391 | protected function limitToMembersAndAlmost(IQueryBuilder $qb) { |
| 392 | 392 | $expr = $qb->expr(); |
| 393 | 393 | |
| 394 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias . '.' : ''; |
|
| 394 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias.'.' : ''; |
|
| 395 | 395 | |
| 396 | 396 | $orX = $expr->orX(); |
| 397 | - $orX->add($expr->eq($pf . 'status', $qb->createNamedParameter(DeprecatedMember::STATUS_MEMBER))); |
|
| 398 | - $orX->add($expr->eq($pf . 'status', $qb->createNamedParameter(DeprecatedMember::STATUS_INVITED))); |
|
| 399 | - $orX->add($expr->eq($pf . 'status', $qb->createNamedParameter(DeprecatedMember::STATUS_REQUEST))); |
|
| 397 | + $orX->add($expr->eq($pf.'status', $qb->createNamedParameter(DeprecatedMember::STATUS_MEMBER))); |
|
| 398 | + $orX->add($expr->eq($pf.'status', $qb->createNamedParameter(DeprecatedMember::STATUS_INVITED))); |
|
| 399 | + $orX->add($expr->eq($pf.'status', $qb->createNamedParameter(DeprecatedMember::STATUS_REQUEST))); |
|
| 400 | 400 | |
| 401 | 401 | $qb->andWhere($orX); |
| 402 | 402 | } |
@@ -409,8 +409,8 @@ discard block |
||
| 409 | 409 | */ |
| 410 | 410 | public function limitToDBField(IQueryBuilder $qb, $field, $value) { |
| 411 | 411 | $expr = $qb->expr(); |
| 412 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias . '.' : ''; |
|
| 413 | - $qb->andWhere($expr->eq($pf . $field, $qb->createNamedParameter($value))); |
|
| 412 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias.'.' : ''; |
|
| 413 | + $qb->andWhere($expr->eq($pf.$field, $qb->createNamedParameter($value))); |
|
| 414 | 414 | } |
| 415 | 415 | |
| 416 | 416 | |
@@ -421,8 +421,8 @@ discard block |
||
| 421 | 421 | */ |
| 422 | 422 | private function limitToDBFieldOrGreater(IQueryBuilder $qb, $field, $value) { |
| 423 | 423 | $expr = $qb->expr(); |
| 424 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias . '.' : ''; |
|
| 425 | - $qb->andWhere($expr->gte($pf . $field, $qb->createNamedParameter($value))); |
|
| 424 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias.'.' : ''; |
|
| 425 | + $qb->andWhere($expr->gte($pf.$field, $qb->createNamedParameter($value))); |
|
| 426 | 426 | } |
| 427 | 427 | |
| 428 | 428 | |
@@ -437,9 +437,9 @@ discard block |
||
| 437 | 437 | protected function limitToNCGroupUser(IQueryBuilder $qb, $userId = '') { |
| 438 | 438 | $expr = $qb->expr(); |
| 439 | 439 | |
| 440 | - $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias . '.' : ''; |
|
| 440 | + $pf = ($qb->getType() === QueryBuilder::SELECT) ? $this->default_select_alias.'.' : ''; |
|
| 441 | 441 | |
| 442 | - $and = $expr->andX($expr->eq($pf . 'user_id', 'ncgu.gid')); |
|
| 442 | + $and = $expr->andX($expr->eq($pf.'user_id', 'ncgu.gid')); |
|
| 443 | 443 | if ($userId !== '') { |
| 444 | 444 | $and->add($expr->eq('ncgu.uid', $qb->createNamedParameter($userId))); |
| 445 | 445 | } else { |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | } |
| 463 | 463 | |
| 464 | 464 | $expr = $qb->expr(); |
| 465 | - $pf = $this->default_select_alias . '.'; |
|
| 465 | + $pf = $this->default_select_alias.'.'; |
|
| 466 | 466 | |
| 467 | 467 | /** @noinspection PhpMethodParametersCountMismatchInspection */ |
| 468 | 468 | $qb->selectAlias('lc.type', 'circle_type') |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | ->selectAlias('lc.settings', 'circle_settings') |
| 472 | 472 | ->leftJoin( |
| 473 | 473 | $this->default_select_alias, DeprecatedRequestBuilder::TABLE_CIRCLES, 'lc', |
| 474 | - $expr->eq($pf . 'circle_id', 'lc.unique_id') |
|
| 474 | + $expr->eq($pf.'circle_id', 'lc.unique_id') |
|
| 475 | 475 | ); |
| 476 | 476 | } |
| 477 | 477 | |