@@ -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) { |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | } |
439 | 439 | |
440 | 440 | $ids = array_map( |
441 | - function (ShareWrapper $share): string { |
|
441 | + function(ShareWrapper $share): string { |
|
442 | 442 | return $share->getId(); |
443 | 443 | }, |
444 | 444 | $this->getItemsFromRequest($qb) |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | $expr = $qb->expr(); |
454 | 454 | $qb->leftJoin( |
455 | 455 | CoreQueryBuilder::SHARE, CoreRequestBuilder::TABLE_SHARE, 'p', |
456 | - $expr->andX($expr->eq('p.id', CoreQueryBuilder::SHARE . '.parent')) |
|
456 | + $expr->andX($expr->eq('p.id', CoreQueryBuilder::SHARE.'.parent')) |
|
457 | 457 | ); |
458 | 458 | |
459 | 459 | $qb->filterNull('parent'); |
@@ -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; |
@@ -403,9 +403,9 @@ discard block |
||
403 | 403 | |
404 | 404 | $display = $circle->getDisplayName(); |
405 | 405 | if ($circle->getSource() === Member::TYPE_CIRCLE) { |
406 | - $display .= ' (Circle owned by ' . $circle->getOwner()->getDisplayName() . ')'; |
|
406 | + $display .= ' (Circle owned by '.$circle->getOwner()->getDisplayName().')'; |
|
407 | 407 | } else { |
408 | - $display .= ' (' . Circle::$DEF_SOURCE[$circle->getSource()] . ')'; |
|
408 | + $display .= ' ('.Circle::$DEF_SOURCE[$circle->getSource()].')'; |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | $share->setSharedWithDisplayName($display); |
@@ -502,20 +502,20 @@ discard block |
||
502 | 502 | |
503 | 503 | public function importFromDatabase(array $data, string $prefix = ''): IQueryRow { |
504 | 504 | $shareTime = new DateTime(); |
505 | - $shareTime->setTimestamp($this->getInt($prefix . 'stime', $data)); |
|
506 | - |
|
507 | - $this->setId($this->get($prefix . 'id', $data)) |
|
508 | - ->setShareType($this->getInt($prefix . 'share_type', $data)) |
|
509 | - ->setPermissions($this->getInt($prefix . 'permissions', $data)) |
|
510 | - ->setItemType($this->get($prefix . 'item_type', $data)) |
|
511 | - ->setItemSource($this->getInt($prefix . 'item_source', $data)) |
|
512 | - ->setItemTarget($this->get($prefix . 'item_target', $data)) |
|
513 | - ->setFileSource($this->getInt($prefix . 'file_source', $data)) |
|
514 | - ->setFileTarget($this->get($prefix . 'file_target', $data)) |
|
515 | - ->setSharedWith($this->get($prefix . 'share_with', $data)) |
|
516 | - ->setSharedBy($this->get($prefix . 'uid_initiator', $data)) |
|
517 | - ->setShareOwner($this->get($prefix . 'uid_owner', $data)) |
|
518 | - ->setToken($this->get($prefix . 'token', $data)) |
|
505 | + $shareTime->setTimestamp($this->getInt($prefix.'stime', $data)); |
|
506 | + |
|
507 | + $this->setId($this->get($prefix.'id', $data)) |
|
508 | + ->setShareType($this->getInt($prefix.'share_type', $data)) |
|
509 | + ->setPermissions($this->getInt($prefix.'permissions', $data)) |
|
510 | + ->setItemType($this->get($prefix.'item_type', $data)) |
|
511 | + ->setItemSource($this->getInt($prefix.'item_source', $data)) |
|
512 | + ->setItemTarget($this->get($prefix.'item_target', $data)) |
|
513 | + ->setFileSource($this->getInt($prefix.'file_source', $data)) |
|
514 | + ->setFileTarget($this->get($prefix.'file_target', $data)) |
|
515 | + ->setSharedWith($this->get($prefix.'share_with', $data)) |
|
516 | + ->setSharedBy($this->get($prefix.'uid_initiator', $data)) |
|
517 | + ->setShareOwner($this->get($prefix.'uid_owner', $data)) |
|
518 | + ->setToken($this->get($prefix.'token', $data)) |
|
519 | 519 | ->setShareTime($shareTime); |
520 | 520 | |
521 | 521 | // if (($password = $this->get('personal_password', $data, '')) !== '') { |
@@ -524,9 +524,9 @@ discard block |
||
524 | 524 | // $share->setPassword($this->get('password', $data, '')); |
525 | 525 | // } |
526 | 526 | |
527 | - $this->setChildId($this->getInt($prefix . 'child_id', $data)) |
|
528 | - ->setChildFileTarget($this->get($prefix . 'child_file_target', $data)) |
|
529 | - ->setChildPermissions($this->getInt($prefix . 'child_permissions', $data)) |
|
527 | + $this->setChildId($this->getInt($prefix.'child_id', $data)) |
|
528 | + ->setChildFileTarget($this->get($prefix.'child_file_target', $data)) |
|
529 | + ->setChildPermissions($this->getInt($prefix.'child_permissions', $data)) |
|
530 | 530 | ->setProviderId(ShareByCircleProvider::IDENTIFIER) |
531 | 531 | ->setStatus(Ishare::STATUS_ACCEPTED); |
532 | 532 |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | */ |
217 | 217 | public function limitToCreation(int $delay = 0): self { |
218 | 218 | $date = new DateTime('now'); |
219 | - $date->sub(new DateInterval('PT' . $delay . 'M')); |
|
219 | + $date->sub(new DateInterval('PT'.$delay.'M')); |
|
220 | 220 | |
221 | 221 | $this->limitToDBFieldDateTime('creation', $date, true); |
222 | 222 | |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | $expr = $this->expr(); |
234 | 234 | $pf = ($this->getType() === DBALQueryBuilder::SELECT) ? $this->getDefaultSelectAlias() |
235 | 235 | . '.' : ''; |
236 | - $field = $pf . $field; |
|
236 | + $field = $pf.$field; |
|
237 | 237 | |
238 | 238 | $orX = $expr->orX(); |
239 | 239 | $orX->add( |
@@ -263,8 +263,8 @@ discard block |
||
263 | 263 | } |
264 | 264 | |
265 | 265 | $expr = $this->expr(); |
266 | - $pf = ($this->getType() === DBALQueryBuilder::SELECT) ? $this->getDefaultSelectAlias() . '.' : ''; |
|
267 | - $field = $pf . $field; |
|
266 | + $pf = ($this->getType() === DBALQueryBuilder::SELECT) ? $this->getDefaultSelectAlias().'.' : ''; |
|
267 | + $field = $pf.$field; |
|
268 | 268 | |
269 | 269 | $orX = $expr->orX(); |
270 | 270 | $orX->add( |
@@ -282,8 +282,8 @@ discard block |
||
282 | 282 | public function searchInDBField(string $field, string $value): void { |
283 | 283 | $expr = $this->expr(); |
284 | 284 | |
285 | - $pf = ($this->getType() === DBALQueryBuilder::SELECT) ? $this->getDefaultSelectAlias() . '.' : ''; |
|
286 | - $field = $pf . $field; |
|
285 | + $pf = ($this->getType() === DBALQueryBuilder::SELECT) ? $this->getDefaultSelectAlias().'.' : ''; |
|
286 | + $field = $pf.$field; |
|
287 | 287 | |
288 | 288 | $this->andWhere($expr->iLike($field, $this->createNamedParameter($value))); |
289 | 289 | } |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | */ |
406 | 406 | public function exprLike(string $field, string $value, string $alias = '', bool $cs = true): string { |
407 | 407 | if ($this->getType() === DBALQueryBuilder::SELECT) { |
408 | - $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; |
|
408 | + $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field; |
|
409 | 409 | } |
410 | 410 | |
411 | 411 | $expr = $this->expr(); |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | |
419 | 419 | public function exprLimit(string $field, string $value, string $alias = '', bool $cs = true): IQueryFunction { |
420 | 420 | if ($this->getType() === DBALQueryBuilder::SELECT) { |
421 | - $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; |
|
421 | + $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field; |
|
422 | 422 | } |
423 | 423 | |
424 | 424 | $expr = $this->expr(); |
@@ -436,7 +436,7 @@ discard block |
||
436 | 436 | |
437 | 437 | public function exprLimitInt(string $field, int $value, string $alias = ''): IQueryFunction { |
438 | 438 | if ($this->getType() === DBALQueryBuilder::SELECT) { |
439 | - $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; |
|
439 | + $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field; |
|
440 | 440 | } |
441 | 441 | |
442 | 442 | $expr = $this->expr(); |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | */ |
455 | 455 | public function exprLimitBool(string $field, bool $value, string $alias = ''): IQueryFunction { |
456 | 456 | if ($this->getType() === DBALQueryBuilder::SELECT) { |
457 | - $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; |
|
457 | + $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field; |
|
458 | 458 | } |
459 | 459 | |
460 | 460 | $expr = $this->expr(); |
@@ -475,7 +475,7 @@ discard block |
||
475 | 475 | string $alias = '' |
476 | 476 | ): ICompositeExpression { |
477 | 477 | if ($this->getType() === DBALQueryBuilder::SELECT) { |
478 | - $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; |
|
478 | + $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field; |
|
479 | 479 | } |
480 | 480 | |
481 | 481 | $expr = $this->expr(); |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | string $alias = '' |
502 | 502 | ): ICompositeExpression { |
503 | 503 | if ($this->getType() === DBALQueryBuilder::SELECT) { |
504 | - $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; |
|
504 | + $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field; |
|
505 | 505 | } |
506 | 506 | |
507 | 507 | $expr = $this->expr(); |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | bool $cs = true |
531 | 531 | ): ICompositeExpression { |
532 | 532 | if ($this->getType() === DBALQueryBuilder::SELECT) { |
533 | - $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; |
|
533 | + $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field; |
|
534 | 534 | } |
535 | 535 | |
536 | 536 | $andX = $this->expr()->andX(); |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | */ |
556 | 556 | public function exprLimitInArray(string $field, array $values, string $alias = ''): IQueryFunction { |
557 | 557 | if ($this->getType() === DBALQueryBuilder::SELECT) { |
558 | - $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; |
|
558 | + $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field; |
|
559 | 559 | } |
560 | 560 | |
561 | 561 | $expr = $this->expr(); |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | */ |
574 | 574 | public function exprLimitBitwise(string $field, int $flag, string $alias = ''): IQueryFunction { |
575 | 575 | if ($this->getType() === DBALQueryBuilder::SELECT) { |
576 | - $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; |
|
576 | + $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field; |
|
577 | 577 | } |
578 | 578 | |
579 | 579 | $expr = $this->expr(); |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | */ |
596 | 596 | public function exprLt(string $field, int $value, bool $lte = false, string $alias = ''): IQueryFunction { |
597 | 597 | if ($this->getType() === DBALQueryBuilder::SELECT) { |
598 | - $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; |
|
598 | + $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field; |
|
599 | 599 | } |
600 | 600 | |
601 | 601 | $expr = $this->expr(); |
@@ -617,7 +617,7 @@ discard block |
||
617 | 617 | */ |
618 | 618 | public function exprGt(string $field, int $value, bool $gte = false, string $alias = ''): IQueryFunction { |
619 | 619 | if ($this->getType() === DBALQueryBuilder::SELECT) { |
620 | - $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; |
|
620 | + $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field; |
|
621 | 621 | } |
622 | 622 | |
623 | 623 | $expr = $this->expr(); |
@@ -726,7 +726,7 @@ discard block |
||
726 | 726 | */ |
727 | 727 | public function exprUnlike(string $field, string $value, string $alias = '', bool $cs = true): string { |
728 | 728 | if ($this->getType() === DBALQueryBuilder::SELECT) { |
729 | - $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; |
|
729 | + $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field; |
|
730 | 730 | } |
731 | 731 | |
732 | 732 | $expr = $this->expr(); |
@@ -750,7 +750,7 @@ discard block |
||
750 | 750 | */ |
751 | 751 | public function exprFilter(string $field, string $value, string $alias = '', bool $cs = true): string { |
752 | 752 | if ($this->getType() === DBALQueryBuilder::SELECT) { |
753 | - $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; |
|
753 | + $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field; |
|
754 | 754 | } |
755 | 755 | |
756 | 756 | $expr = $this->expr(); |
@@ -776,7 +776,7 @@ discard block |
||
776 | 776 | */ |
777 | 777 | public function exprFilterInt(string $field, int $value, string $alias = ''): string { |
778 | 778 | if ($this->getType() === DBALQueryBuilder::SELECT) { |
779 | - $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; |
|
779 | + $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field; |
|
780 | 780 | } |
781 | 781 | |
782 | 782 | $expr = $this->expr(); |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | */ |
795 | 795 | public function exprFilterBool(string $field, bool $value, string $alias = ''): string { |
796 | 796 | if ($this->getType() === DBALQueryBuilder::SELECT) { |
797 | - $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; |
|
797 | + $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field; |
|
798 | 798 | } |
799 | 799 | |
800 | 800 | $expr = $this->expr(); |
@@ -815,7 +815,7 @@ discard block |
||
815 | 815 | string $alias = '' |
816 | 816 | ): ICompositeExpression { |
817 | 817 | if ($this->getType() === DBALQueryBuilder::SELECT) { |
818 | - $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; |
|
818 | + $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field; |
|
819 | 819 | } |
820 | 820 | |
821 | 821 | $expr = $this->expr(); |
@@ -841,7 +841,7 @@ discard block |
||
841 | 841 | string $alias = '' |
842 | 842 | ): ICompositeExpression { |
843 | 843 | if ($this->getType() === DBALQueryBuilder::SELECT) { |
844 | - $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; |
|
844 | + $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field; |
|
845 | 845 | } |
846 | 846 | |
847 | 847 | $expr = $this->expr(); |
@@ -870,7 +870,7 @@ discard block |
||
870 | 870 | bool $cs = true |
871 | 871 | ): ICompositeExpression { |
872 | 872 | if ($this->getType() === DBALQueryBuilder::SELECT) { |
873 | - $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; |
|
873 | + $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field; |
|
874 | 874 | } |
875 | 875 | |
876 | 876 | $orX = $this->expr()->orX(); |
@@ -895,7 +895,7 @@ discard block |
||
895 | 895 | */ |
896 | 896 | public function exprFilterInArray(string $field, array $values, string $alias = ''): string { |
897 | 897 | if ($this->getType() === DBALQueryBuilder::SELECT) { |
898 | - $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; |
|
898 | + $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field; |
|
899 | 899 | } |
900 | 900 | |
901 | 901 | $expr = $this->expr(); |
@@ -913,7 +913,7 @@ discard block |
||
913 | 913 | */ |
914 | 914 | public function exprFilterBitwise(string $field, int $flag, string $alias = ''): IQueryFunction { |
915 | 915 | if ($this->getType() === DBALQueryBuilder::SELECT) { |
916 | - $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias) . '.' . $field; |
|
916 | + $field = (($alias === '') ? $this->getDefaultSelectAlias() : $alias).'.'.$field; |
|
917 | 917 | } |
918 | 918 | |
919 | 919 | $expr = $this->expr(); |
@@ -1074,12 +1074,12 @@ discard block |
||
1074 | 1074 | string $alias = '' |
1075 | 1075 | ): self { |
1076 | 1076 | $selectFields = array_map( |
1077 | - function (string $item) use ($alias) { |
|
1077 | + function(string $item) use ($alias) { |
|
1078 | 1078 | if ($alias === '') { |
1079 | 1079 | return $item; |
1080 | 1080 | } |
1081 | 1081 | |
1082 | - return $alias . '.' . $item; |
|
1082 | + return $alias.'.'.$item; |
|
1083 | 1083 | }, $fields |
1084 | 1084 | ); |
1085 | 1085 | |
@@ -1105,13 +1105,13 @@ discard block |
||
1105 | 1105 | string $prefix, |
1106 | 1106 | array $default = [] |
1107 | 1107 | ): self { |
1108 | - $prefix = trim($prefix) . '_'; |
|
1108 | + $prefix = trim($prefix).'_'; |
|
1109 | 1109 | foreach ($default as $k => $v) { |
1110 | - $this->addDefaultValue($prefix . $k, (string)$v); |
|
1110 | + $this->addDefaultValue($prefix.$k, (string)$v); |
|
1111 | 1111 | } |
1112 | 1112 | |
1113 | 1113 | foreach ($fields as $field) { |
1114 | - $this->selectAlias($alias . '.' . $field, $prefix . $field); |
|
1114 | + $this->selectAlias($alias.'.'.$field, $prefix.$field); |
|
1115 | 1115 | } |
1116 | 1116 | |
1117 | 1117 | return $this; |
@@ -402,8 +402,8 @@ discard block |
||
402 | 402 | foreach (explode(' ', $circle->getDisplayName()) as $word) { |
403 | 403 | $andX->add( |
404 | 404 | $expr->iLike( |
405 | - $this->getDefaultSelectAlias() . '.' . 'display_name', |
|
406 | - $this->createNamedParameter('%' . $word . '%') |
|
405 | + $this->getDefaultSelectAlias().'.'.'display_name', |
|
406 | + $this->createNamedParameter('%'.$word.'%') |
|
407 | 407 | ) |
408 | 408 | ); |
409 | 409 | } |
@@ -414,8 +414,8 @@ discard block |
||
414 | 414 | foreach (explode(' ', $circle->getDescription()) as $word) { |
415 | 415 | $orDescription->add( |
416 | 416 | $expr->iLike( |
417 | - $this->getDefaultSelectAlias() . '.' . 'description', |
|
418 | - $this->createNamedParameter('%' . $word . '%') |
|
417 | + $this->getDefaultSelectAlias().'.'.'description', |
|
418 | + $this->createNamedParameter('%'.$word.'%') |
|
419 | 419 | ) |
420 | 420 | ); |
421 | 421 | } |
@@ -445,7 +445,7 @@ discard block |
||
445 | 445 | $this->generateRemoteInstanceSelectAlias($aliasRemoteInstance) |
446 | 446 | ->leftJoin( |
447 | 447 | $alias, CoreRequestBuilder::TABLE_REMOTE, $aliasRemoteInstance, |
448 | - $expr->eq($alias . '.instance', $aliasRemoteInstance . '.instance') |
|
448 | + $expr->eq($alias.'.instance', $aliasRemoteInstance.'.instance') |
|
449 | 449 | ); |
450 | 450 | } catch (RequestBuilderException $e) { |
451 | 451 | } |
@@ -497,7 +497,7 @@ discard block |
||
497 | 497 | $expr = $this->expr(); |
498 | 498 | $this->leftJoin( |
499 | 499 | $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_REMOTE, $aliasRemote, |
500 | - $expr->eq($aliasRemote . '.instance', $this->createNamedParameter($remoteInstance->getInstance())) |
|
500 | + $expr->eq($aliasRemote.'.instance', $this->createNamedParameter($remoteInstance->getInstance())) |
|
501 | 501 | ); |
502 | 502 | } |
503 | 503 | |
@@ -525,12 +525,12 @@ discard block |
||
525 | 525 | $this->leftJoin( |
526 | 526 | $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $aliasRemoteMember, |
527 | 527 | $expr->andX( |
528 | - $expr->eq($aliasRemoteMember . '.circle_id', $aliasCircle . '.unique_id'), |
|
528 | + $expr->eq($aliasRemoteMember.'.circle_id', $aliasCircle.'.unique_id'), |
|
529 | 529 | $expr->eq( |
530 | - $aliasRemoteMember . '.instance', |
|
530 | + $aliasRemoteMember.'.instance', |
|
531 | 531 | $this->createNamedParameter($remoteInstance->getInstance()) |
532 | 532 | ), |
533 | - $expr->gte($aliasRemoteMember . '.level', $this->createNamedParameter(Member::LEVEL_MEMBER)) |
|
533 | + $expr->gte($aliasRemoteMember.'.level', $this->createNamedParameter(Member::LEVEL_MEMBER)) |
|
534 | 534 | ) |
535 | 535 | ); |
536 | 536 | } |
@@ -562,21 +562,21 @@ discard block |
||
562 | 562 | $this->leftJoin( |
563 | 563 | $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $aliasRemoteCircle, |
564 | 564 | $expr->andX( |
565 | - $expr->eq($aliasRemoteCircle . '.single_id', $aliasCircle . '.unique_id'), |
|
566 | - $expr->emptyString($aliasRemoteCircle . '.instance'), |
|
567 | - $expr->gte($aliasRemoteCircle . '.level', $this->createNamedParameter(Member::LEVEL_MEMBER)) |
|
565 | + $expr->eq($aliasRemoteCircle.'.single_id', $aliasCircle.'.unique_id'), |
|
566 | + $expr->emptyString($aliasRemoteCircle.'.instance'), |
|
567 | + $expr->gte($aliasRemoteCircle.'.level', $this->createNamedParameter(Member::LEVEL_MEMBER)) |
|
568 | 568 | ) |
569 | 569 | ); |
570 | 570 | $this->leftJoin( |
571 | 571 | $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $aliasRemoteCircleOwner, |
572 | 572 | $expr->andX( |
573 | - $expr->eq($aliasRemoteCircle . '.circle_id', $aliasRemoteCircleOwner . '.circle_id'), |
|
573 | + $expr->eq($aliasRemoteCircle.'.circle_id', $aliasRemoteCircleOwner.'.circle_id'), |
|
574 | 574 | $expr->eq( |
575 | - $aliasRemoteCircleOwner . '.instance', |
|
575 | + $aliasRemoteCircleOwner.'.instance', |
|
576 | 576 | $this->createNamedParameter($remoteInstance->getInstance()) |
577 | 577 | ), |
578 | 578 | $expr->eq( |
579 | - $aliasRemoteCircleOwner . '.level', $this->createNamedParameter(Member::LEVEL_OWNER) |
|
579 | + $aliasRemoteCircleOwner.'.level', $this->createNamedParameter(Member::LEVEL_OWNER) |
|
580 | 580 | ) |
581 | 581 | ) |
582 | 582 | ); |
@@ -609,16 +609,16 @@ discard block |
||
609 | 609 | $expr = $this->expr(); |
610 | 610 | $orX = $expr->orX(); |
611 | 611 | $orX->add( |
612 | - $expr->eq($aliasRemote . '.type', $this->createNamedParameter(RemoteInstance::TYPE_GLOBALSCALE)) |
|
612 | + $expr->eq($aliasRemote.'.type', $this->createNamedParameter(RemoteInstance::TYPE_GLOBALSCALE)) |
|
613 | 613 | ); |
614 | 614 | |
615 | 615 | $orExtOrPassive = $expr->orX(); |
616 | 616 | $orExtOrPassive->add( |
617 | - $expr->eq($aliasRemote . '.type', $this->createNamedParameter(RemoteInstance::TYPE_EXTERNAL)) |
|
617 | + $expr->eq($aliasRemote.'.type', $this->createNamedParameter(RemoteInstance::TYPE_EXTERNAL)) |
|
618 | 618 | ); |
619 | 619 | if (!$sensitive) { |
620 | 620 | $orExtOrPassive->add( |
621 | - $expr->eq($aliasRemote . '.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE)) |
|
621 | + $expr->eq($aliasRemote.'.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE)) |
|
622 | 622 | ); |
623 | 623 | } else { |
624 | 624 | if ($this->getDefaultSelectAlias() === CoreQueryBuilder::MEMBER) { |
@@ -627,8 +627,8 @@ discard block |
||
627 | 627 | } |
628 | 628 | |
629 | 629 | $orInstance = $expr->orX(); |
630 | - $orInstance->add($expr->isNotNull($aliasRemoteMember . '.instance')); |
|
631 | - $orInstance->add($expr->isNotNull($aliasRemoteCircleOwner . '.instance')); |
|
630 | + $orInstance->add($expr->isNotNull($aliasRemoteMember.'.instance')); |
|
631 | + $orInstance->add($expr->isNotNull($aliasRemoteCircleOwner.'.instance')); |
|
632 | 632 | |
633 | 633 | $andExternal = $expr->andX(); |
634 | 634 | $andExternal->add($orExtOrPassive); |
@@ -637,13 +637,13 @@ discard block |
||
637 | 637 | $orExtOrTrusted = $expr->orX(); |
638 | 638 | $orExtOrTrusted->add($andExternal); |
639 | 639 | $orExtOrTrusted->add( |
640 | - $expr->eq($aliasRemote . '.type', $this->createNamedParameter(RemoteInstance::TYPE_TRUSTED)) |
|
640 | + $expr->eq($aliasRemote.'.type', $this->createNamedParameter(RemoteInstance::TYPE_TRUSTED)) |
|
641 | 641 | ); |
642 | 642 | |
643 | 643 | $andTrusted = $expr->andX(); |
644 | 644 | $andTrusted->add($orExtOrTrusted); |
645 | 645 | $andTrusted->add($this->exprLimitBitwise('config', Circle::CFG_FEDERATED, $aliasCircle)); |
646 | - $andTrusted->add($expr->emptyString($aliasOwner . '.instance')); |
|
646 | + $andTrusted->add($expr->emptyString($aliasOwner.'.instance')); |
|
647 | 647 | $orX->add($andTrusted); |
648 | 648 | |
649 | 649 | $this->andWhere($orX); |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | } |
671 | 671 | $this->innerJoin( |
672 | 672 | $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $aliasMember, |
673 | - $expr->eq($aliasMember . '.circle_id', $alias . '.unique_id') |
|
673 | + $expr->eq($aliasMember.'.circle_id', $alias.'.unique_id') |
|
674 | 674 | ); |
675 | 675 | |
676 | 676 | $this->filterDirectMembership($aliasMember, $member); |
@@ -695,12 +695,12 @@ discard block |
||
695 | 695 | $aliasCircle, |
696 | 696 | 'circles_membership', |
697 | 697 | $aliasMembership, |
698 | - $this->expr()->eq($aliasCircle . '.unique_id', $aliasMembership . '.circle_id') |
|
698 | + $this->expr()->eq($aliasCircle.'.unique_id', $aliasMembership.'.circle_id') |
|
699 | 699 | ); |
700 | 700 | |
701 | 701 | $this->andWhere( |
702 | 702 | $this->expr()->eq( |
703 | - $aliasMembership . '.single_id', |
|
703 | + $aliasMembership.'.single_id', |
|
704 | 704 | $this->createNamedParameter($federatedUser->getSingleId()) |
705 | 705 | ) |
706 | 706 | ); |
@@ -721,19 +721,19 @@ discard block |
||
721 | 721 | |
722 | 722 | if ($member->getUserId() !== '') { |
723 | 723 | $andX->add( |
724 | - $expr->eq($aliasMember . '.user_id', $this->createNamedParameter($member->getUserId())) |
|
724 | + $expr->eq($aliasMember.'.user_id', $this->createNamedParameter($member->getUserId())) |
|
725 | 725 | ); |
726 | 726 | } |
727 | 727 | |
728 | 728 | if ($member->getSingleId() !== '') { |
729 | 729 | $andX->add( |
730 | - $expr->eq($aliasMember . '.single_id', $this->createNamedParameter($member->getSingleId())) |
|
730 | + $expr->eq($aliasMember.'.single_id', $this->createNamedParameter($member->getSingleId())) |
|
731 | 731 | ); |
732 | 732 | } |
733 | 733 | |
734 | 734 | if ($member->getUserType() > 0) { |
735 | 735 | $andX->add( |
736 | - $expr->eq($aliasMember . '.user_type', $this->createNamedParameter($member->getUserType())) |
|
736 | + $expr->eq($aliasMember.'.user_type', $this->createNamedParameter($member->getUserType())) |
|
737 | 737 | ); |
738 | 738 | } |
739 | 739 | |
@@ -742,7 +742,7 @@ discard block |
||
742 | 742 | if ($member->getLevel() > 0) { |
743 | 743 | $andX->add( |
744 | 744 | $expr->gte( |
745 | - $aliasMember . '.level', |
|
745 | + $aliasMember.'.level', |
|
746 | 746 | $this->createNamedParameter($member->getLevel(), IQueryBuilder::PARAM_INT) |
747 | 747 | ) |
748 | 748 | ); |
@@ -783,7 +783,7 @@ discard block |
||
783 | 783 | $helperAlias, |
784 | 784 | CoreRequestBuilder::TABLE_CIRCLE, |
785 | 785 | $aliasCircle, |
786 | - $expr->eq($aliasCircle . '.unique_id', $helperAlias . '.' . $field) |
|
786 | + $expr->eq($aliasCircle.'.unique_id', $helperAlias.'.'.$field) |
|
787 | 787 | ); |
788 | 788 | |
789 | 789 | if (!is_null($initiator)) { |
@@ -814,7 +814,7 @@ discard block |
||
814 | 814 | $this->generateCircleSelectAlias($aliasInvitedBy) |
815 | 815 | ->leftJoin( |
816 | 816 | $aliasMember, CoreRequestBuilder::TABLE_CIRCLE, $aliasInvitedBy, |
817 | - $expr->eq($aliasMember . '.invited_by', $aliasInvitedBy . '.unique_id') |
|
817 | + $expr->eq($aliasMember.'.invited_by', $aliasInvitedBy.'.unique_id') |
|
818 | 818 | ); |
819 | 819 | |
820 | 820 | $this->leftJoinOwner($aliasInvitedBy); |
@@ -845,7 +845,7 @@ discard block |
||
845 | 845 | $this->generateCircleSelectAlias($aliasBasedOn) |
846 | 846 | ->leftJoin( |
847 | 847 | $aliasMember, CoreRequestBuilder::TABLE_CIRCLE, $aliasBasedOn, |
848 | - $expr->eq($aliasBasedOn . '.unique_id', $aliasMember . '.single_id') |
|
848 | + $expr->eq($aliasBasedOn.'.unique_id', $aliasMember.'.single_id') |
|
849 | 849 | ); |
850 | 850 | |
851 | 851 | if (!is_null($initiator)) { |
@@ -878,9 +878,9 @@ discard block |
||
878 | 878 | ->leftJoin( |
879 | 879 | $alias, CoreRequestBuilder::TABLE_MEMBER, $aliasMember, |
880 | 880 | $expr->andX( |
881 | - $expr->eq($aliasMember . '.circle_id', $alias . '.' . $field), |
|
881 | + $expr->eq($aliasMember.'.circle_id', $alias.'.'.$field), |
|
882 | 882 | $expr->eq( |
883 | - $aliasMember . '.level', |
|
883 | + $aliasMember.'.level', |
|
884 | 884 | $this->createNamedParameter(Member::LEVEL_OWNER, self::PARAM_INT) |
885 | 885 | ) |
886 | 886 | ) |
@@ -918,10 +918,10 @@ discard block |
||
918 | 918 | ->leftJoin( |
919 | 919 | $alias, CoreRequestBuilder::TABLE_MEMBER, $aliasMember, |
920 | 920 | $expr->andX( |
921 | - $expr->eq($aliasMember . '.circle_id', $alias . '.' . $fieldCircleId), |
|
922 | - $expr->eq($aliasMember . '.single_id', $alias . '.' . $fieldSingleId), |
|
921 | + $expr->eq($aliasMember.'.circle_id', $alias.'.'.$fieldCircleId), |
|
922 | + $expr->eq($aliasMember.'.single_id', $alias.'.'.$fieldSingleId), |
|
923 | 923 | $expr->gte( |
924 | - $aliasMember . '.level', |
|
924 | + $aliasMember.'.level', |
|
925 | 925 | $this->createNamedParameter(Member::LEVEL_MEMBER, self::PARAM_INT) |
926 | 926 | ) |
927 | 927 | ) |
@@ -954,7 +954,7 @@ discard block |
||
954 | 954 | |
955 | 955 | $this->leftJoin( |
956 | 956 | $alias, CoreRequestBuilder::TABLE_MEMBERSHIP, $aliasMembership, |
957 | - $expr->eq($aliasMembership . '.circle_id', $alias . '.' . $field) |
|
957 | + $expr->eq($aliasMembership.'.circle_id', $alias.'.'.$field) |
|
958 | 958 | ); |
959 | 959 | |
960 | 960 | // if (!$this->getBool('getData', $options, false)) { |
@@ -968,8 +968,8 @@ discard block |
||
968 | 968 | ->leftJoin( |
969 | 969 | $alias, CoreRequestBuilder::TABLE_MEMBER, $aliasInheritedBy, |
970 | 970 | $expr->andX( |
971 | - $expr->eq($aliasMembership . '.inheritance_last', $aliasInheritedBy . '.circle_id'), |
|
972 | - $expr->eq($aliasMembership . '.single_id', $aliasInheritedBy . '.single_id') |
|
971 | + $expr->eq($aliasMembership.'.inheritance_last', $aliasInheritedBy.'.circle_id'), |
|
972 | + $expr->eq($aliasMembership.'.single_id', $aliasInheritedBy.'.single_id') |
|
973 | 973 | ) |
974 | 974 | ); |
975 | 975 | |
@@ -986,12 +986,12 @@ discard block |
||
986 | 986 | $aliasUpstreamMembership = $this->generateAlias($alias, self::UPSTREAM_MEMBERSHIPS, $options); |
987 | 987 | $this->leftJoin( |
988 | 988 | $alias, CoreRequestBuilder::TABLE_MEMBERSHIP, $aliasUpstreamMembership, |
989 | - $expr->eq($aliasUpstreamMembership . '.single_id', $this->createNamedParameter($singleId)) |
|
989 | + $expr->eq($aliasUpstreamMembership.'.single_id', $this->createNamedParameter($singleId)) |
|
990 | 990 | ); |
991 | 991 | |
992 | 992 | $orX = $expr->orX( |
993 | - $expr->eq($aliasUpstreamMembership . '.circle_id', $alias . '.' . $field), |
|
994 | - $expr->eq($alias . '.' . $field, $this->createNamedParameter($singleId)) |
|
993 | + $expr->eq($aliasUpstreamMembership.'.circle_id', $alias.'.'.$field), |
|
994 | + $expr->eq($alias.'.'.$field, $this->createNamedParameter($singleId)) |
|
995 | 995 | ); |
996 | 996 | |
997 | 997 | $this->andWhere($orX); |
@@ -1012,11 +1012,11 @@ discard block |
||
1012 | 1012 | |
1013 | 1013 | $expr = $this->expr(); |
1014 | 1014 | $aliasMembership = $this->generateAlias($alias, self::MEMBERSHIPS); |
1015 | - $this->andWhere($expr->eq($aliasMembership . '.circle_id', $this->createNamedParameter($singleId))); |
|
1015 | + $this->andWhere($expr->eq($aliasMembership.'.circle_id', $this->createNamedParameter($singleId))); |
|
1016 | 1016 | if ($level > 1) { |
1017 | 1017 | $this->andWhere( |
1018 | 1018 | $expr->gte( |
1019 | - $aliasMembership . '.level', |
|
1019 | + $aliasMembership.'.level', |
|
1020 | 1020 | $this->createNamedParameter($level, IQueryBuilder::PARAM_INT) |
1021 | 1021 | ) |
1022 | 1022 | ); |
@@ -1044,8 +1044,8 @@ discard block |
||
1044 | 1044 | $this->leftJoin( |
1045 | 1045 | $alias, CoreRequestBuilder::TABLE_MEMBERSHIP, $aliasMembership, |
1046 | 1046 | $expr->andX( |
1047 | - $expr->eq($aliasMembership . '.inheritance_last', $alias . '.' . $field), |
|
1048 | - $expr->eq($aliasMembership . '.single_id', $alias . '.single_id') |
|
1047 | + $expr->eq($aliasMembership.'.inheritance_last', $alias.'.'.$field), |
|
1048 | + $expr->eq($aliasMembership.'.single_id', $alias.'.single_id') |
|
1049 | 1049 | ) |
1050 | 1050 | ); |
1051 | 1051 | |
@@ -1058,8 +1058,8 @@ discard block |
||
1058 | 1058 | ->leftJoin( |
1059 | 1059 | $aliasMembership, CoreRequestBuilder::TABLE_MEMBER, $aliasInheritanceFrom, |
1060 | 1060 | $expr->andX( |
1061 | - $expr->eq($aliasMembership . '.circle_id', $aliasInheritanceFrom . '.circle_id'), |
|
1062 | - $expr->eq($aliasMembership . '.inheritance_first', $aliasInheritanceFrom . '.single_id') |
|
1061 | + $expr->eq($aliasMembership.'.circle_id', $aliasInheritanceFrom.'.circle_id'), |
|
1062 | + $expr->eq($aliasMembership.'.inheritance_first', $aliasInheritanceFrom.'.single_id') |
|
1063 | 1063 | ) |
1064 | 1064 | ); |
1065 | 1065 | } |
@@ -1099,7 +1099,7 @@ discard block |
||
1099 | 1099 | |
1100 | 1100 | $this->leftJoin( |
1101 | 1101 | $alias, CoreRequestBuilder::TABLE_TOKEN, $aliasShareToken, |
1102 | - $expr->eq($aliasShareToken . '.share_id', $alias . '.' . $field) |
|
1102 | + $expr->eq($aliasShareToken.'.share_id', $alias.'.'.$field) |
|
1103 | 1103 | ); |
1104 | 1104 | } |
1105 | 1105 | |
@@ -1143,14 +1143,14 @@ discard block |
||
1143 | 1143 | try { |
1144 | 1144 | $aliasConfig = $this->generateAlias($alias, self::CONFIG, $options); |
1145 | 1145 | $this->selectAlias( |
1146 | - $aliasConfig . '.config', |
|
1147 | - (($alias !== $this->getDefaultSelectAlias()) ? $alias . '_' : '') . 'circle_config' |
|
1146 | + $aliasConfig.'.config', |
|
1147 | + (($alias !== $this->getDefaultSelectAlias()) ? $alias.'_' : '').'circle_config' |
|
1148 | 1148 | ); |
1149 | 1149 | $this->leftJoin( |
1150 | 1150 | $alias, |
1151 | 1151 | CoreRequestBuilder::TABLE_CIRCLE, |
1152 | 1152 | $aliasConfig, |
1153 | - $expr->eq($alias . '.circle_id', $aliasConfig . '.unique_id') |
|
1153 | + $expr->eq($alias.'.circle_id', $aliasConfig.'.unique_id') |
|
1154 | 1154 | ); |
1155 | 1155 | } catch (RequestBuilderException $e) { |
1156 | 1156 | } |
@@ -1180,7 +1180,7 @@ discard block |
||
1180 | 1180 | } |
1181 | 1181 | |
1182 | 1182 | if (!empty($helperMoreFields)) { |
1183 | - $helperMoreFields[] = $helperAlias . '.' . $field; |
|
1183 | + $helperMoreFields[] = $helperAlias.'.'.$field; |
|
1184 | 1184 | } |
1185 | 1185 | |
1186 | 1186 | $expr = $this->expr(); |
@@ -1191,7 +1191,7 @@ discard block |
||
1191 | 1191 | |
1192 | 1192 | $orXMembershipFields = $expr->orX(); |
1193 | 1193 | foreach ($helperMoreFields as $f) { |
1194 | - $orXMembershipFields->add($expr->eq($aliasMembership . '.circle_id', $f)); |
|
1194 | + $orXMembershipFields->add($expr->eq($aliasMembership.'.circle_id', $f)); |
|
1195 | 1195 | } |
1196 | 1196 | |
1197 | 1197 | $this->leftJoin( |
@@ -1201,8 +1201,7 @@ discard block |
||
1201 | 1201 | $expr->andX( |
1202 | 1202 | $this->exprLimit('single_id', $initiator->getSingleId(), $aliasMembership), |
1203 | 1203 | (empty($helperMoreFields)) ? |
1204 | - $expr->eq($aliasMembership . '.circle_id', $helperAlias . '.' . $field) : |
|
1205 | - $orXMembershipFields |
|
1204 | + $expr->eq($aliasMembership.'.circle_id', $helperAlias.'.'.$field) : $orXMembershipFields |
|
1206 | 1205 | ) |
1207 | 1206 | ); |
1208 | 1207 | |
@@ -1221,11 +1220,11 @@ discard block |
||
1221 | 1220 | $aliasMembershipCircle = $this->generateAlias($aliasMembership, self::CONFIG, $options); |
1222 | 1221 | $orXMembershipCircle = $expr->orX(); |
1223 | 1222 | array_map( |
1224 | - function (string $alias) use ($orXMembershipCircle, $aliasMembershipCircle) { |
|
1223 | + function(string $alias) use ($orXMembershipCircle, $aliasMembershipCircle) { |
|
1225 | 1224 | $orXMembershipCircle->add( |
1226 | 1225 | $this->expr()->eq( |
1227 | - $alias . '.circle_id', |
|
1228 | - $aliasMembershipCircle . '.unique_id' |
|
1226 | + $alias.'.circle_id', |
|
1227 | + $aliasMembershipCircle.'.unique_id' |
|
1229 | 1228 | ) |
1230 | 1229 | ); |
1231 | 1230 | }, |
@@ -1253,7 +1252,7 @@ discard block |
||
1253 | 1252 | |
1254 | 1253 | $orXDirectFields = $expr->orX(); |
1255 | 1254 | foreach ($helperMoreFields as $f) { |
1256 | - $orXDirectFields->add($expr->eq($aliasMembership . '.circle_id', $f)); |
|
1255 | + $orXDirectFields->add($expr->eq($aliasMembership.'.circle_id', $f)); |
|
1257 | 1256 | } |
1258 | 1257 | |
1259 | 1258 | $this->generateMemberSelectAlias($aliasDirect) |
@@ -1264,8 +1263,7 @@ discard block |
||
1264 | 1263 | $expr->andX( |
1265 | 1264 | $this->exprLimit('single_id', $initiator->getSingleId(), $aliasDirect), |
1266 | 1265 | (empty($helperMoreFields)) ? |
1267 | - $expr->eq($aliasDirect . '.circle_id', $helperAlias . '.' . $field) : |
|
1268 | - $orXDirectFields |
|
1266 | + $expr->eq($aliasDirect.'.circle_id', $helperAlias.'.'.$field) : $orXDirectFields |
|
1269 | 1267 | ) |
1270 | 1268 | ); |
1271 | 1269 | } catch (RequestBuilderException $e) { |
@@ -1279,8 +1277,8 @@ discard block |
||
1279 | 1277 | $this->leftJoin( |
1280 | 1278 | $aliasMembership, CoreRequestBuilder::TABLE_MEMBER, $aliasInitiator, |
1281 | 1279 | $expr->andX( |
1282 | - $expr->eq($aliasMembership . '.inheritance_first', $aliasInitiator . '.single_id'), |
|
1283 | - $expr->eq($aliasMembership . '.circle_id', $aliasInitiator . '.circle_id') |
|
1280 | + $expr->eq($aliasMembership.'.inheritance_first', $aliasInitiator.'.single_id'), |
|
1281 | + $expr->eq($aliasMembership.'.circle_id', $aliasInitiator.'.circle_id') |
|
1284 | 1282 | ) |
1285 | 1283 | ); |
1286 | 1284 | |
@@ -1288,8 +1286,8 @@ discard block |
||
1288 | 1286 | $this->leftJoin( |
1289 | 1287 | $aliasInitiator, CoreRequestBuilder::TABLE_MEMBER, $aliasInheritedBy, |
1290 | 1288 | $expr->andX( |
1291 | - $expr->eq($aliasMembership . '.single_id', $aliasInheritedBy . '.single_id'), |
|
1292 | - $expr->eq($aliasMembership . '.inheritance_last', $aliasInheritedBy . '.circle_id') |
|
1289 | + $expr->eq($aliasMembership.'.single_id', $aliasInheritedBy.'.single_id'), |
|
1290 | + $expr->eq($aliasMembership.'.inheritance_last', $aliasInheritedBy.'.circle_id') |
|
1293 | 1291 | ) |
1294 | 1292 | ); |
1295 | 1293 | |
@@ -1340,7 +1338,7 @@ discard block |
||
1340 | 1338 | $orX->add( |
1341 | 1339 | $expr->andX( |
1342 | 1340 | $this->exprLimitBitwise('config', Circle::CFG_PERSONAL, $aliasMembershipCircle), |
1343 | - $expr->eq($aliasMembership . '.level', $this->createNamedParameter(Member::LEVEL_OWNER)) |
|
1341 | + $expr->eq($aliasMembership.'.level', $this->createNamedParameter(Member::LEVEL_OWNER)) |
|
1344 | 1342 | ) |
1345 | 1343 | ); |
1346 | 1344 | } |
@@ -1350,10 +1348,10 @@ discard block |
||
1350 | 1348 | $orXLevelCheck = $expr->orX(); |
1351 | 1349 | |
1352 | 1350 | array_map( |
1353 | - function (string $alias) use ($orXLevelCheck, $minimumLevel) { |
|
1351 | + function(string $alias) use ($orXLevelCheck, $minimumLevel) { |
|
1354 | 1352 | $orXLevelCheck->add( |
1355 | 1353 | $this->expr()->gte( |
1356 | - $alias . '.level', |
|
1354 | + $alias.'.level', |
|
1357 | 1355 | $this->createNamedParameter($minimumLevel) |
1358 | 1356 | ) |
1359 | 1357 | ); |
@@ -1443,21 +1441,21 @@ discard block |
||
1443 | 1441 | $expr = $this->expr(); |
1444 | 1442 | $andPassive = $expr->andX(); |
1445 | 1443 | $andPassive->add( |
1446 | - $expr->eq($alias . '.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE)) |
|
1444 | + $expr->eq($alias.'.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE)) |
|
1447 | 1445 | ); |
1448 | 1446 | |
1449 | 1447 | $orMemberOrLevel = $expr->orX(); |
1450 | 1448 | $orMemberOrLevel->add( |
1451 | - $expr->eq($this->getDefaultSelectAlias() . '.instance', $alias . '.instance') |
|
1449 | + $expr->eq($this->getDefaultSelectAlias().'.instance', $alias.'.instance') |
|
1452 | 1450 | ); |
1453 | 1451 | // TODO: do we need this ? (display members from the local instance) |
1454 | 1452 | $orMemberOrLevel->add( |
1455 | - $expr->emptyString($this->getDefaultSelectAlias() . '.instance') |
|
1453 | + $expr->emptyString($this->getDefaultSelectAlias().'.instance') |
|
1456 | 1454 | ); |
1457 | 1455 | |
1458 | 1456 | $orMemberOrLevel->add( |
1459 | 1457 | $expr->eq( |
1460 | - $this->getDefaultSelectAlias() . '.level', |
|
1458 | + $this->getDefaultSelectAlias().'.level', |
|
1461 | 1459 | $this->createNamedParameter(Member::LEVEL_OWNER) |
1462 | 1460 | ) |
1463 | 1461 | ); |
@@ -1494,11 +1492,11 @@ discard block |
||
1494 | 1492 | ) |
1495 | 1493 | ->leftJoin( |
1496 | 1494 | $aliasShare, CoreRequestBuilder::TABLE_FILE_CACHE, $aliasFileCache, |
1497 | - $expr->eq($aliasShare . '.file_source', $aliasFileCache . '.fileid') |
|
1495 | + $expr->eq($aliasShare.'.file_source', $aliasFileCache.'.fileid') |
|
1498 | 1496 | ) |
1499 | 1497 | ->leftJoin( |
1500 | 1498 | $aliasFileCache, CoreRequestBuilder::TABLE_STORAGES, $aliasStorages, |
1501 | - $expr->eq($aliasFileCache . '.storage', $aliasStorages . '.numeric_id') |
|
1499 | + $expr->eq($aliasFileCache.'.storage', $aliasStorages.'.numeric_id') |
|
1502 | 1500 | ); |
1503 | 1501 | } |
1504 | 1502 | |
@@ -1520,8 +1518,8 @@ discard block |
||
1520 | 1518 | $this->leftJoin( |
1521 | 1519 | $aliasShareMemberships, CoreRequestBuilder::TABLE_SHARE, $aliasShareChild, |
1522 | 1520 | $expr->andX( |
1523 | - $expr->eq($aliasShareChild . '.parent', $aliasShare . '.id'), |
|
1524 | - $expr->eq($aliasShareChild . '.share_with', $aliasShareMemberships . '.single_id') |
|
1521 | + $expr->eq($aliasShareChild.'.parent', $aliasShare.'.id'), |
|
1522 | + $expr->eq($aliasShareChild.'.share_with', $aliasShareMemberships.'.single_id') |
|
1525 | 1523 | ) |
1526 | 1524 | ); |
1527 | 1525 | |
@@ -1571,13 +1569,13 @@ discard block |
||
1571 | 1569 | $this->leftJoin( |
1572 | 1570 | $aliasMountMemberships, CoreRequestBuilder::TABLE_MOUNTPOINT, $aliasMountpoint, |
1573 | 1571 | $expr->andX( |
1574 | - $expr->eq($aliasMountpoint . '.mount_id', $aliasMount . '.mount_id'), |
|
1575 | - $expr->eq($aliasMountpoint . '.single_id', $aliasMountMemberships . '.single_id') |
|
1572 | + $expr->eq($aliasMountpoint.'.mount_id', $aliasMount.'.mount_id'), |
|
1573 | + $expr->eq($aliasMountpoint.'.single_id', $aliasMountMemberships.'.single_id') |
|
1576 | 1574 | ) |
1577 | 1575 | ); |
1578 | 1576 | |
1579 | - $this->selectAlias($aliasMountpoint . '.mountpoint', $aliasMountpoint . '_mountpoint'); |
|
1580 | - $this->selectAlias($aliasMountpoint . '.mountpoint_hash', $aliasMountpoint . '_mountpoint_hash'); |
|
1577 | + $this->selectAlias($aliasMountpoint.'.mountpoint', $aliasMountpoint.'_mountpoint'); |
|
1578 | + $this->selectAlias($aliasMountpoint.'.mountpoint_hash', $aliasMountpoint.'_mountpoint_hash'); |
|
1581 | 1579 | } |
1582 | 1580 | |
1583 | 1581 | |
@@ -1685,10 +1683,10 @@ discard block |
||
1685 | 1683 | */ |
1686 | 1684 | public function generateAlias(string $base, string $extension, ?array &$options = []): string { |
1687 | 1685 | $search = str_replace('_', '.', $base); |
1688 | - $path = $search . '.' . $extension; |
|
1686 | + $path = $search.'.'.$extension; |
|
1689 | 1687 | if (!$this->validKey($path, self::$SQL_PATH) |
1690 | 1688 | && !in_array($extension, $this->getArray($search, self::$SQL_PATH))) { |
1691 | - throw new RequestBuilderException($extension . ' not found in ' . $search); |
|
1689 | + throw new RequestBuilderException($extension.' not found in '.$search); |
|
1692 | 1690 | } |
1693 | 1691 | |
1694 | 1692 | if (!is_array($options)) { |
@@ -1697,15 +1695,15 @@ discard block |
||
1697 | 1695 | |
1698 | 1696 | $optionPath = ''; |
1699 | 1697 | foreach (explode('.', $path) as $p) { |
1700 | - $optionPath = trim($optionPath . '.' . $p, '.'); |
|
1698 | + $optionPath = trim($optionPath.'.'.$p, '.'); |
|
1701 | 1699 | $options = array_merge( |
1702 | 1700 | $options, |
1703 | - $this->getArray($optionPath . '.' . self::OPTIONS, self::$SQL_PATH), |
|
1704 | - $this->getArray($optionPath . '.' . self::OPTIONS, $this->options) |
|
1701 | + $this->getArray($optionPath.'.'.self::OPTIONS, self::$SQL_PATH), |
|
1702 | + $this->getArray($optionPath.'.'.self::OPTIONS, $this->options) |
|
1705 | 1703 | ); |
1706 | 1704 | } |
1707 | 1705 | |
1708 | - return $base . '_' . $extension; |
|
1706 | + return $base.'_'.$extension; |
|
1709 | 1707 | } |
1710 | 1708 | |
1711 | 1709 | |
@@ -1725,7 +1723,7 @@ discard block |
||
1725 | 1723 | } else { |
1726 | 1724 | $k = $arr; |
1727 | 1725 | } |
1728 | - $path[$k] = $prefix . '_' . $k . '_'; |
|
1726 | + $path[$k] = $prefix.'_'.$k.'_'; |
|
1729 | 1727 | } |
1730 | 1728 | |
1731 | 1729 | return $path; |