Completed
Push — master ( 8dabac...269796 )
by Maxence
02:53 queued 11s
created
lib/Model/Circle.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -84,26 +84,26 @@  discard block
 block discarded – undo
84 84
 
85 85
 
86 86
 	// specific value
87
-	const CFG_CIRCLE = 0;        // only for code readability. Circle is locked by default.
88
-	const CFG_SINGLE = 1;        // Circle with only one single member.
89
-	const CFG_PERSONAL = 2;      // Personal circle, only the owner can see it.
87
+	const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default.
88
+	const CFG_SINGLE = 1; // Circle with only one single member.
89
+	const CFG_PERSONAL = 2; // Personal circle, only the owner can see it.
90 90
 
91 91
 	// bitwise
92
-	const CFG_SYSTEM = 4;            // System Circle (not managed by the official front-end). Meaning some config are limited
93
-	const CFG_VISIBLE = 8;           // Visible to everyone, if not visible, people have to know its name to be able to find it
94
-	const CFG_OPEN = 16;             // Circle is open, people can join
95
-	const CFG_INVITE = 32;           // Adding a member generate an invitation that needs to be accepted
96
-	const CFG_REQUEST = 64;          // Request to join Circles needs to be confirmed by a moderator
97
-	const CFG_FRIEND = 128;          // Members of the circle can invite their friends
98
-	const CFG_PROTECTED = 256;       // Password protected to join/request
99
-	const CFG_NO_OWNER = 512;        // no owner, only members
100
-	const CFG_HIDDEN = 1024;         // hidden from listing, but available as a share entity
101
-	const CFG_BACKEND = 2048;            // Fully hidden, only backend Circles
102
-	const CFG_LOCAL = 4096;              // Local even on GlobalScale
103
-	const CFG_ROOT = 8192;               // Circle cannot be inside another Circle
104
-	const CFG_CIRCLE_INVITE = 16384;     // Circle must confirm when invited in another circle
105
-	const CFG_FEDERATED = 32768;         // Federated
106
-	const CFG_MOUNTPOINT = 65536;        // Generate a Files folder for this Circle
92
+	const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited
93
+	const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it
94
+	const CFG_OPEN = 16; // Circle is open, people can join
95
+	const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted
96
+	const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator
97
+	const CFG_FRIEND = 128; // Members of the circle can invite their friends
98
+	const CFG_PROTECTED = 256; // Password protected to join/request
99
+	const CFG_NO_OWNER = 512; // no owner, only members
100
+	const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity
101
+	const CFG_BACKEND = 2048; // Fully hidden, only backend Circles
102
+	const CFG_LOCAL = 4096; // Local even on GlobalScale
103
+	const CFG_ROOT = 8192; // Circle cannot be inside another Circle
104
+	const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle
105
+	const CFG_FEDERATED = 32768; // Federated
106
+	const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle
107 107
 
108 108
 	public static $DEF_CFG_MAX = 131071;
109 109
 
@@ -702,22 +702,22 @@  discard block
 block discarded – undo
702 702
 	 * @throws CircleNotFoundException
703 703
 	 */
704 704
 	public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow {
705
-		if ($this->get($prefix . 'unique_id', $data) === '') {
705
+		if ($this->get($prefix.'unique_id', $data) === '') {
706 706
 			throw new CircleNotFoundException();
707 707
 		}
708 708
 
709
-		$this->setSingleId($this->get($prefix . 'unique_id', $data))
710
-			 ->setName($this->get($prefix . 'name', $data))
711
-			 ->setDisplayName($this->get($prefix . 'display_name', $data))
712
-			 ->setConfig($this->getInt($prefix . 'config', $data))
713
-			 ->setSource($this->getInt($prefix . 'source', $data))
714
-			 ->setInstance($this->get($prefix . 'instance', $data))
715
-			 ->setSettings($this->getArray($prefix . 'settings', $data))
716
-			 ->setContactAddressBook($this->getInt($prefix . 'contact_addressbook', $data))
717
-			 ->setContactGroupName($this->get($prefix . 'contact_groupname', $data))
718
-			 ->setDescription($this->get($prefix . 'description', $data));
719
-
720
-		$creation = $this->get($prefix . 'creation', $data);
709
+		$this->setSingleId($this->get($prefix.'unique_id', $data))
710
+			 ->setName($this->get($prefix.'name', $data))
711
+			 ->setDisplayName($this->get($prefix.'display_name', $data))
712
+			 ->setConfig($this->getInt($prefix.'config', $data))
713
+			 ->setSource($this->getInt($prefix.'source', $data))
714
+			 ->setInstance($this->get($prefix.'instance', $data))
715
+			 ->setSettings($this->getArray($prefix.'settings', $data))
716
+			 ->setContactAddressBook($this->getInt($prefix.'contact_addressbook', $data))
717
+			 ->setContactGroupName($this->get($prefix.'contact_groupname', $data))
718
+			 ->setDescription($this->get($prefix.'description', $data));
719
+
720
+		$creation = $this->get($prefix.'creation', $data);
721 721
 		$this->setCreation(DateTime::createFromFormat('Y-m-d H:i:s', $creation)->getTimestamp());
722 722
 
723 723
 		$this->getManager()->manageImportFromDatabase($this, $data, $prefix);
Please login to merge, or discard this patch.
lib/Db/CoreQueryBuilder.php 1 patch
Spacing   +79 added lines, -79 removed lines patch added patch discarded remove patch
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
 	 * @param int $config
249 249
 	 */
250 250
 	public function limitToConfigFlag(int $config): void {
251
-		$this->andWhere($this->expr()->bitwiseAnd($this->getDefaultSelectAlias() . '.config', $config));
251
+		$this->andWhere($this->expr()->bitwiseAnd($this->getDefaultSelectAlias().'.config', $config));
252 252
 	}
253 253
 
254 254
 
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 		}
333 333
 
334 334
 		if ($circle->getDisplayName() !== '') {
335
-			$this->searchInDBField('display_name', '%' . $circle->getDisplayName() . '%');
335
+			$this->searchInDBField('display_name', '%'.$circle->getDisplayName().'%');
336 336
 		}
337 337
 	}
338 338
 
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 			$this->generateRemoteInstanceSelectAlias($aliasRemoteInstance)
349 349
 				 ->leftJoin(
350 350
 					 $alias, CoreRequestBuilder::TABLE_REMOTE, $aliasRemoteInstance,
351
-					 $expr->eq($alias . '.instance', $aliasRemoteInstance . '.instance')
351
+					 $expr->eq($alias.'.instance', $aliasRemoteInstance.'.instance')
352 352
 				 );
353 353
 		} catch (RequestBuilderException $e) {
354 354
 		}
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 		$expr = $this->expr();
402 402
 		$this->leftJoin(
403 403
 			$this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_REMOTE, $aliasRemote,
404
-			$expr->eq($aliasRemote . '.instance', $this->createNamedParameter($remoteInstance->getInstance()))
404
+			$expr->eq($aliasRemote.'.instance', $this->createNamedParameter($remoteInstance->getInstance()))
405 405
 		);
406 406
 	}
407 407
 
@@ -429,12 +429,12 @@  discard block
 block discarded – undo
429 429
 		$this->leftJoin(
430 430
 			$this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $aliasRemoteMember,
431 431
 			$expr->andX(
432
-				$expr->eq($aliasRemoteMember . '.circle_id', $aliasCircle . '.unique_id'),
432
+				$expr->eq($aliasRemoteMember.'.circle_id', $aliasCircle.'.unique_id'),
433 433
 				$expr->eq(
434
-					$aliasRemoteMember . '.instance',
434
+					$aliasRemoteMember.'.instance',
435 435
 					$this->createNamedParameter($remoteInstance->getInstance())
436 436
 				),
437
-				$expr->gte($aliasRemoteMember . '.level', $this->createNamedParameter(Member::LEVEL_MEMBER))
437
+				$expr->gte($aliasRemoteMember.'.level', $this->createNamedParameter(Member::LEVEL_MEMBER))
438 438
 			)
439 439
 		);
440 440
 	}
@@ -466,21 +466,21 @@  discard block
 block discarded – undo
466 466
 		$this->leftJoin(
467 467
 			$this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $aliasRemoteCircle,
468 468
 			$expr->andX(
469
-				$expr->eq($aliasRemoteCircle . '.single_id', $aliasCircle . '.unique_id'),
470
-				$expr->emptyString($aliasRemoteCircle . '.instance'),
471
-				$expr->gte($aliasRemoteCircle . '.level', $this->createNamedParameter(Member::LEVEL_MEMBER))
469
+				$expr->eq($aliasRemoteCircle.'.single_id', $aliasCircle.'.unique_id'),
470
+				$expr->emptyString($aliasRemoteCircle.'.instance'),
471
+				$expr->gte($aliasRemoteCircle.'.level', $this->createNamedParameter(Member::LEVEL_MEMBER))
472 472
 			)
473 473
 		);
474 474
 		$this->leftJoin(
475 475
 			$this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $aliasRemoteCircleOwner,
476 476
 			$expr->andX(
477
-				$expr->eq($aliasRemoteCircle . '.circle_id', $aliasRemoteCircleOwner . '.circle_id'),
477
+				$expr->eq($aliasRemoteCircle.'.circle_id', $aliasRemoteCircleOwner.'.circle_id'),
478 478
 				$expr->eq(
479
-					$aliasRemoteCircleOwner . '.instance',
479
+					$aliasRemoteCircleOwner.'.instance',
480 480
 					$this->createNamedParameter($remoteInstance->getInstance())
481 481
 				),
482 482
 				$expr->eq(
483
-					$aliasRemoteCircleOwner . '.level', $this->createNamedParameter(Member::LEVEL_OWNER)
483
+					$aliasRemoteCircleOwner.'.level', $this->createNamedParameter(Member::LEVEL_OWNER)
484 484
 				)
485 485
 			)
486 486
 		);
@@ -513,16 +513,16 @@  discard block
 block discarded – undo
513 513
 		$expr = $this->expr();
514 514
 		$orX = $expr->orX();
515 515
 		$orX->add(
516
-			$expr->eq($aliasRemote . '.type', $this->createNamedParameter(RemoteInstance::TYPE_GLOBALSCALE))
516
+			$expr->eq($aliasRemote.'.type', $this->createNamedParameter(RemoteInstance::TYPE_GLOBALSCALE))
517 517
 		);
518 518
 
519 519
 		$orExtOrPassive = $expr->orX();
520 520
 		$orExtOrPassive->add(
521
-			$expr->eq($aliasRemote . '.type', $this->createNamedParameter(RemoteInstance::TYPE_EXTERNAL))
521
+			$expr->eq($aliasRemote.'.type', $this->createNamedParameter(RemoteInstance::TYPE_EXTERNAL))
522 522
 		);
523 523
 		if (!$sensitive) {
524 524
 			$orExtOrPassive->add(
525
-				$expr->eq($aliasRemote . '.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE))
525
+				$expr->eq($aliasRemote.'.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE))
526 526
 			);
527 527
 		} else {
528 528
 			if ($this->getDefaultSelectAlias() === CoreQueryBuilder::MEMBER) {
@@ -531,8 +531,8 @@  discard block
 block discarded – undo
531 531
 		}
532 532
 
533 533
 		$orInstance = $expr->orX();
534
-		$orInstance->add($expr->isNotNull($aliasRemoteMember . '.instance'));
535
-		$orInstance->add($expr->isNotNull($aliasRemoteCircleOwner . '.instance'));
534
+		$orInstance->add($expr->isNotNull($aliasRemoteMember.'.instance'));
535
+		$orInstance->add($expr->isNotNull($aliasRemoteCircleOwner.'.instance'));
536 536
 
537 537
 		$andExternal = $expr->andX();
538 538
 		$andExternal->add($orExtOrPassive);
@@ -541,13 +541,13 @@  discard block
 block discarded – undo
541 541
 		$orExtOrTrusted = $expr->orX();
542 542
 		$orExtOrTrusted->add($andExternal);
543 543
 		$orExtOrTrusted->add(
544
-			$expr->eq($aliasRemote . '.type', $this->createNamedParameter(RemoteInstance::TYPE_TRUSTED))
544
+			$expr->eq($aliasRemote.'.type', $this->createNamedParameter(RemoteInstance::TYPE_TRUSTED))
545 545
 		);
546 546
 
547 547
 		$andTrusted = $expr->andX();
548 548
 		$andTrusted->add($orExtOrTrusted);
549
-		$andTrusted->add($expr->bitwiseAnd($aliasCircle . '.config', Circle::CFG_FEDERATED));
550
-		$andTrusted->add($expr->emptyString($aliasOwner . '.instance'));
549
+		$andTrusted->add($expr->bitwiseAnd($aliasCircle.'.config', Circle::CFG_FEDERATED));
550
+		$andTrusted->add($expr->emptyString($aliasOwner.'.instance'));
551 551
 		$orX->add($andTrusted);
552 552
 
553 553
 		$this->andWhere($orX);
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 		}
575 575
 		$this->leftJoin(
576 576
 			$this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $aliasMember,
577
-			$expr->eq($aliasMember . '.circle_id', $alias . '.unique_id')
577
+			$expr->eq($aliasMember.'.circle_id', $alias.'.unique_id')
578 578
 		);
579 579
 
580 580
 		$this->filterDirectMembership($aliasMember, $member);
@@ -595,28 +595,28 @@  discard block
 block discarded – undo
595 595
 
596 596
 		if ($member->getUserId() !== '') {
597 597
 			$andX->add(
598
-				$expr->eq($aliasMember . '.user_id', $this->createNamedParameter($member->getUserId()))
598
+				$expr->eq($aliasMember.'.user_id', $this->createNamedParameter($member->getUserId()))
599 599
 			);
600 600
 		}
601 601
 
602 602
 		if ($member->getSingleId() !== '') {
603 603
 			$andX->add(
604
-				$expr->eq($aliasMember . '.single_id', $this->createNamedParameter($member->getSingleId()))
604
+				$expr->eq($aliasMember.'.single_id', $this->createNamedParameter($member->getSingleId()))
605 605
 			);
606 606
 		}
607 607
 
608 608
 		if ($member->getUserType() > 0) {
609 609
 			$andX->add(
610
-				$expr->eq($aliasMember . '.user_type', $this->createNamedParameter($member->getUserType()))
610
+				$expr->eq($aliasMember.'.user_type', $this->createNamedParameter($member->getUserType()))
611 611
 			);
612 612
 		}
613 613
 
614 614
 		$andX->add(
615
-			$expr->eq($aliasMember . '.instance', $this->createNamedParameter($this->getInstance($member)))
615
+			$expr->eq($aliasMember.'.instance', $this->createNamedParameter($this->getInstance($member)))
616 616
 		);
617 617
 
618 618
 		if ($member->getLevel() > 0) {
619
-			$andX->add($expr->gte($aliasMember . '.level', $this->createNamedParameter($member->getLevel())));
619
+			$andX->add($expr->gte($aliasMember.'.level', $this->createNamedParameter($member->getLevel())));
620 620
 		}
621 621
 
622 622
 		$this->andWhere($andX);
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
 
650 650
 		$this->leftJoin(
651 651
 			$alias, CoreRequestBuilder::TABLE_CIRCLE, $aliasCircle,
652
-			$expr->eq($aliasCircle . '.unique_id', $alias . '.' . $field)
652
+			$expr->eq($aliasCircle.'.unique_id', $alias.'.'.$field)
653 653
 		);
654 654
 
655 655
 		if (!is_null($initiator)) {
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
 		$this->generateCircleSelectAlias($aliasBasedOn)
685 685
 			 ->leftJoin(
686 686
 				 $aliasMember, CoreRequestBuilder::TABLE_CIRCLE, $aliasBasedOn,
687
-				 $expr->eq($aliasBasedOn . '.unique_id', $aliasMember . '.single_id')
687
+				 $expr->eq($aliasBasedOn.'.unique_id', $aliasMember.'.single_id')
688 688
 			 );
689 689
 
690 690
 		if (!is_null($initiator)) {
@@ -717,9 +717,9 @@  discard block
 block discarded – undo
717 717
 			 ->leftJoin(
718 718
 				 $alias, CoreRequestBuilder::TABLE_MEMBER, $aliasMember,
719 719
 				 $expr->andX(
720
-					 $expr->eq($aliasMember . '.circle_id', $alias . '.' . $field),
720
+					 $expr->eq($aliasMember.'.circle_id', $alias.'.'.$field),
721 721
 					 $expr->eq(
722
-						 $aliasMember . '.level',
722
+						 $aliasMember.'.level',
723 723
 						 $this->createNamedParameter(Member::LEVEL_OWNER, self::PARAM_INT)
724 724
 					 )
725 725
 				 )
@@ -757,10 +757,10 @@  discard block
 block discarded – undo
757 757
 			 ->leftJoin(
758 758
 				 $alias, CoreRequestBuilder::TABLE_MEMBER, $aliasMember,
759 759
 				 $expr->andX(
760
-					 $expr->eq($aliasMember . '.circle_id', $alias . '.' . $fieldCircleId),
761
-					 $expr->eq($aliasMember . '.single_id', $alias . '.' . $fieldSingleId),
760
+					 $expr->eq($aliasMember.'.circle_id', $alias.'.'.$fieldCircleId),
761
+					 $expr->eq($aliasMember.'.single_id', $alias.'.'.$fieldSingleId),
762 762
 					 $expr->gte(
763
-						 $aliasMember . '.level',
763
+						 $aliasMember.'.level',
764 764
 						 $this->createNamedParameter(Member::LEVEL_MEMBER, self::PARAM_INT)
765 765
 					 )
766 766
 				 )
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
 
791 791
 		$this->leftJoin(
792 792
 			$alias, CoreRequestBuilder::TABLE_MEMBERSHIP, $aliasMembership,
793
-			$expr->eq($aliasMembership . '.circle_id', $alias . '.' . $field)
793
+			$expr->eq($aliasMembership.'.circle_id', $alias.'.'.$field)
794 794
 		);
795 795
 
796 796
 //		if (!$this->getBool('getData', $options, false)) {
@@ -804,8 +804,8 @@  discard block
 block discarded – undo
804 804
 			 ->leftJoin(
805 805
 				 $alias, CoreRequestBuilder::TABLE_MEMBER, $aliasInheritedBy,
806 806
 				 $expr->andX(
807
-					 $expr->eq($aliasMembership . '.inheritance_last', $aliasInheritedBy . '.circle_id'),
808
-					 $expr->eq($aliasMembership . '.single_id', $aliasInheritedBy . '.single_id')
807
+					 $expr->eq($aliasMembership.'.inheritance_last', $aliasInheritedBy.'.circle_id'),
808
+					 $expr->eq($aliasMembership.'.single_id', $aliasInheritedBy.'.single_id')
809 809
 				 )
810 810
 			 );
811 811
 
@@ -822,12 +822,12 @@  discard block
 block discarded – undo
822 822
 		$aliasUpstreamMembership = $this->generateAlias($alias, self::UPSTREAM_MEMBERSHIPS, $options);
823 823
 		$this->leftJoin(
824 824
 			$alias, CoreRequestBuilder::TABLE_MEMBERSHIP, $aliasUpstreamMembership,
825
-			$expr->eq($aliasUpstreamMembership . '.single_id', $this->createNamedParameter($singleId))
825
+			$expr->eq($aliasUpstreamMembership.'.single_id', $this->createNamedParameter($singleId))
826 826
 		);
827 827
 
828 828
 		$orX = $expr->orX(
829
-			$expr->eq($aliasUpstreamMembership . '.circle_id', $alias . '.' . $field),
830
-			$expr->eq($alias . '.' . $field, $this->createNamedParameter($singleId))
829
+			$expr->eq($aliasUpstreamMembership.'.circle_id', $alias.'.'.$field),
830
+			$expr->eq($alias.'.'.$field, $this->createNamedParameter($singleId))
831 831
 		);
832 832
 
833 833
 		$this->andWhere($orX);
@@ -847,7 +847,7 @@  discard block
 block discarded – undo
847 847
 
848 848
 		$expr = $this->expr();
849 849
 		$aliasMembership = $this->generateAlias($alias, self::MEMBERSHIPS);
850
-		$this->andWhere($expr->eq($aliasMembership . '.circle_id', $this->createNamedParameter($singleId)));
850
+		$this->andWhere($expr->eq($aliasMembership.'.circle_id', $this->createNamedParameter($singleId)));
851 851
 	}
852 852
 
853 853
 
@@ -871,7 +871,7 @@  discard block
 block discarded – undo
871 871
 		$this->leftJoin(
872 872
 			$alias, CoreRequestBuilder::TABLE_MEMBERSHIP, $aliasMembership,
873 873
 //			$expr->andX(
874
-			$expr->eq($aliasMembership . '.inheritance_last', $alias . '.' . $field)
874
+			$expr->eq($aliasMembership.'.inheritance_last', $alias.'.'.$field)
875 875
 //				$expr->eq($aliasMembership . '.single_id', $alias . '.single_id')
876 876
 //			)
877 877
 		);
@@ -885,8 +885,8 @@  discard block
 block discarded – undo
885 885
 			 ->leftJoin(
886 886
 				 $aliasMembership, CoreRequestBuilder::TABLE_MEMBER, $aliasInheritanceFrom,
887 887
 				 $expr->andX(
888
-					 $expr->eq($aliasMembership . '.circle_id', $aliasInheritanceFrom . '.circle_id'),
889
-					 $expr->eq($aliasMembership . '.inheritance_first', $aliasInheritanceFrom . '.single_id')
888
+					 $expr->eq($aliasMembership.'.circle_id', $aliasInheritanceFrom.'.circle_id'),
889
+					 $expr->eq($aliasMembership.'.inheritance_first', $aliasInheritanceFrom.'.single_id')
890 890
 				 )
891 891
 			 );
892 892
 	}
@@ -934,10 +934,10 @@  discard block
 block discarded – undo
934 934
 			$alias, CoreRequestBuilder::TABLE_MEMBERSHIP, $aliasMembership,
935 935
 			$expr->andX(
936 936
 				$expr->eq(
937
-					$aliasMembership . '.single_id',
937
+					$aliasMembership.'.single_id',
938 938
 					$this->createNamedParameter($initiator->getSingleId())
939 939
 				),
940
-				$expr->eq($aliasMembership . '.circle_id', $alias . '.' . $field)
940
+				$expr->eq($aliasMembership.'.circle_id', $alias.'.'.$field)
941 941
 			)
942 942
 		);
943 943
 
@@ -950,8 +950,8 @@  discard block
 block discarded – undo
950 950
 			$this->leftJoin(
951 951
 				$aliasMembership, CoreRequestBuilder::TABLE_MEMBER, $aliasInitiator,
952 952
 				$expr->andX(
953
-					$expr->eq($aliasMembership . '.inheritance_first', $aliasInitiator . '.single_id'),
954
-					$expr->eq($aliasMembership . '.circle_id', $aliasInitiator . '.circle_id')
953
+					$expr->eq($aliasMembership.'.inheritance_first', $aliasInitiator.'.single_id'),
954
+					$expr->eq($aliasMembership.'.circle_id', $aliasInitiator.'.circle_id')
955 955
 				)
956 956
 			);
957 957
 
@@ -959,8 +959,8 @@  discard block
 block discarded – undo
959 959
 			$this->leftJoin(
960 960
 				$aliasInitiator, CoreRequestBuilder::TABLE_MEMBER, $aliasInheritedBy,
961 961
 				$expr->andX(
962
-					$expr->eq($aliasMembership . '.single_id', $aliasInheritedBy . '.single_id'),
963
-					$expr->eq($aliasMembership . '.inheritance_last', $aliasInheritedBy . '.circle_id')
962
+					$expr->eq($aliasMembership.'.single_id', $aliasInheritedBy.'.single_id'),
963
+					$expr->eq($aliasMembership.'.inheritance_last', $aliasInheritedBy.'.circle_id')
964 964
 				)
965 965
 			);
966 966
 
@@ -979,7 +979,7 @@  discard block
 block discarded – undo
979 979
 			$aliasInheritedByMembership = $this->generateAlias($aliasInheritedBy, self::MEMBERSHIPS);
980 980
 			$this->generateMembershipSelectAlias($aliasMembership, $aliasInheritedByMembership);
981 981
 		} catch (RequestBuilderException $e) {
982
-			\OC::$server->getLogger()->log(3, '-- ' . $e->getMessage());
982
+			\OC::$server->getLogger()->log(3, '-- '.$e->getMessage());
983 983
 		}
984 984
 	}
985 985
 
@@ -1002,31 +1002,31 @@  discard block
 block discarded – undo
1002 1002
 		$orX = $expr->orX();
1003 1003
 		$orX->add(
1004 1004
 			$expr->andX(
1005
-				$expr->gte($aliasMembership . '.level', $this->createNamedParameter(Member::LEVEL_MEMBER))
1005
+				$expr->gte($aliasMembership.'.level', $this->createNamedParameter(Member::LEVEL_MEMBER))
1006 1006
 			)
1007 1007
 		);
1008 1008
 
1009 1009
 		if ($getPersonalCircle) {
1010 1010
 			$orX->add(
1011 1011
 				$expr->andX(
1012
-					$expr->bitwiseAnd($alias . '.config', Circle::CFG_PERSONAL),
1013
-					$expr->eq($aliasMembership . '.level', $this->createNamedParameter(Member::LEVEL_OWNER))
1012
+					$expr->bitwiseAnd($alias.'.config', Circle::CFG_PERSONAL),
1013
+					$expr->eq($aliasMembership.'.level', $this->createNamedParameter(Member::LEVEL_OWNER))
1014 1014
 				)
1015 1015
 			);
1016 1016
 		}
1017 1017
 		if (!$this->getBool('mustBeMember', $options, true)) {
1018
-			$orX->add($expr->bitwiseAnd($alias . '.config', Circle::CFG_VISIBLE));
1018
+			$orX->add($expr->bitwiseAnd($alias.'.config', Circle::CFG_VISIBLE));
1019 1019
 		}
1020 1020
 		if ($this->getBool('canBeVisitor', $options, false)) {
1021 1021
 			// TODO: should find a better way, also filter on remote initiator on non-federated ?
1022
-			$orX->add($expr->gte($alias . '.config', $this->createNamedParameter(0)));
1022
+			$orX->add($expr->gte($alias.'.config', $this->createNamedParameter(0)));
1023 1023
 		}
1024 1024
 		if ($this->getBool('canBeVisitorOnOpen', $options, false)) {
1025 1025
 			echo '!!!!';
1026 1026
 			$andOpen = $expr->andX();
1027
-			$andOpen->add($expr->bitwiseAnd($alias . '.config', Circle::CFG_OPEN));
1027
+			$andOpen->add($expr->bitwiseAnd($alias.'.config', Circle::CFG_OPEN));
1028 1028
 			$andOpen->add(
1029
-				$this->createFunction('NOT') . $expr->bitwiseAnd($alias . '.config', Circle::CFG_REQUEST)
1029
+				$this->createFunction('NOT').$expr->bitwiseAnd($alias.'.config', Circle::CFG_REQUEST)
1030 1030
 			);
1031 1031
 			$orX->add($andOpen);
1032 1032
 		}
@@ -1070,7 +1070,7 @@  discard block
 block discarded – undo
1070 1070
 		$hide = $expr->andX();
1071 1071
 		foreach (Circle::$DEF_CFG as $cfg => $v) {
1072 1072
 			if ($flag & $cfg) {
1073
-				$hide->add($this->createFunction('NOT') . $expr->bitwiseAnd($aliasCircle . '.config', $cfg));
1073
+				$hide->add($this->createFunction('NOT').$expr->bitwiseAnd($aliasCircle.'.config', $cfg));
1074 1074
 			}
1075 1075
 		}
1076 1076
 
@@ -1089,21 +1089,21 @@  discard block
 block discarded – undo
1089 1089
 		$expr = $this->expr();
1090 1090
 		$andPassive = $expr->andX();
1091 1091
 		$andPassive->add(
1092
-			$expr->eq($alias . '.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE))
1092
+			$expr->eq($alias.'.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE))
1093 1093
 		);
1094 1094
 
1095 1095
 		$orMemberOrLevel = $expr->orX();
1096 1096
 		$orMemberOrLevel->add(
1097
-			$expr->eq($this->getDefaultSelectAlias() . '.instance', $alias . '.instance')
1097
+			$expr->eq($this->getDefaultSelectAlias().'.instance', $alias.'.instance')
1098 1098
 		);
1099 1099
 		// TODO: do we need this ? (display members from the local instance)
1100 1100
 		$orMemberOrLevel->add(
1101
-			$expr->emptyString($this->getDefaultSelectAlias() . '.instance')
1101
+			$expr->emptyString($this->getDefaultSelectAlias().'.instance')
1102 1102
 		);
1103 1103
 
1104 1104
 		$orMemberOrLevel->add(
1105 1105
 			$expr->eq(
1106
-				$this->getDefaultSelectAlias() . '.level',
1106
+				$this->getDefaultSelectAlias().'.level',
1107 1107
 				$this->createNamedParameter(Member::LEVEL_OWNER)
1108 1108
 			)
1109 1109
 		);
@@ -1119,7 +1119,7 @@  discard block
 block discarded – undo
1119 1119
 	 * @param int $flag
1120 1120
 	 */
1121 1121
 	public function filterConfig(string $aliasCircle, int $flag): void {
1122
-		$this->andWhere($this->expr()->bitwiseAnd($aliasCircle . '.config', $flag));
1122
+		$this->andWhere($this->expr()->bitwiseAnd($aliasCircle.'.config', $flag));
1123 1123
 	}
1124 1124
 
1125 1125
 
@@ -1150,11 +1150,11 @@  discard block
 block discarded – undo
1150 1150
 			 )
1151 1151
 			 ->leftJoin(
1152 1152
 				 $aliasShare, CoreRequestBuilder::TABLE_FILE_CACHE, $aliasFileCache,
1153
-				 $expr->eq($aliasShare . '.file_source', $aliasFileCache . '.fileid')
1153
+				 $expr->eq($aliasShare.'.file_source', $aliasFileCache.'.fileid')
1154 1154
 			 )
1155 1155
 			 ->leftJoin(
1156 1156
 				 $aliasFileCache, CoreRequestBuilder::TABLE_STORAGES, $aliasStorages,
1157
-				 $expr->eq($aliasFileCache . '.storage', $aliasStorages . '.numeric_id')
1157
+				 $expr->eq($aliasFileCache.'.storage', $aliasStorages.'.numeric_id')
1158 1158
 			 );
1159 1159
 	}
1160 1160
 
@@ -1176,8 +1176,8 @@  discard block
 block discarded – undo
1176 1176
 		$this->leftJoin(
1177 1177
 			$aliasShareMemberships, CoreRequestBuilder::TABLE_SHARE, $aliasShareChild,
1178 1178
 			$expr->andX(
1179
-				$expr->eq($aliasShareChild . '.parent', $aliasShare . '.id'),
1180
-				$expr->eq($aliasShareChild . '.share_with', $aliasShareMemberships . '.single_id')
1179
+				$expr->eq($aliasShareChild.'.parent', $aliasShare.'.id'),
1180
+				$expr->eq($aliasShareChild.'.share_with', $aliasShareMemberships.'.single_id')
1181 1181
 			)
1182 1182
 		);
1183 1183
 
@@ -1227,13 +1227,13 @@  discard block
 block discarded – undo
1227 1227
 		$this->leftJoin(
1228 1228
 			$aliasMountMemberships, CoreRequestBuilder::TABLE_MOUNTPOINT, $aliasMountpoint,
1229 1229
 			$expr->andX(
1230
-				$expr->eq($aliasMountpoint . '.mount_id', $aliasMount . '.mount_id'),
1231
-				$expr->eq($aliasMountpoint . '.single_id', $aliasMountMemberships . '.single_id')
1230
+				$expr->eq($aliasMountpoint.'.mount_id', $aliasMount.'.mount_id'),
1231
+				$expr->eq($aliasMountpoint.'.single_id', $aliasMountMemberships.'.single_id')
1232 1232
 			)
1233 1233
 		);
1234 1234
 
1235
-		$this->selectAlias($aliasMountpoint . '.mountpoint', $aliasMountpoint . '_mountpoint');
1236
-		$this->selectAlias($aliasMountpoint . '.mountpoint_hash', $aliasMountpoint . '_mountpoint_hash');
1235
+		$this->selectAlias($aliasMountpoint.'.mountpoint', $aliasMountpoint.'_mountpoint');
1236
+		$this->selectAlias($aliasMountpoint.'.mountpoint_hash', $aliasMountpoint.'_mountpoint_hash');
1237 1237
 	}
1238 1238
 
1239 1239
 
@@ -1337,10 +1337,10 @@  discard block
 block discarded – undo
1337 1337
 	 */
1338 1338
 	public function generateAlias(string $base, string $extension, ?array &$options = []): string {
1339 1339
 		$search = str_replace('_', '.', $base);
1340
-		$path = $search . '.' . $extension;
1340
+		$path = $search.'.'.$extension;
1341 1341
 		if (!$this->validKey($path, self::$SQL_PATH)
1342 1342
 			&& !in_array($extension, $this->getArray($search, self::$SQL_PATH))) {
1343
-			throw new RequestBuilderException($extension . ' not found in ' . $search);
1343
+			throw new RequestBuilderException($extension.' not found in '.$search);
1344 1344
 		}
1345 1345
 
1346 1346
 		if (!is_array($options)) {
@@ -1349,15 +1349,15 @@  discard block
 block discarded – undo
1349 1349
 
1350 1350
 		$optionPath = '';
1351 1351
 		foreach (explode('.', $path) as $p) {
1352
-			$optionPath = trim($optionPath . '.' . $p, '.');
1352
+			$optionPath = trim($optionPath.'.'.$p, '.');
1353 1353
 			$options = array_merge(
1354 1354
 				$options,
1355
-				$this->getArray($optionPath . '.' . self::OPTIONS, self::$SQL_PATH),
1356
-				$this->getArray($optionPath . '.' . self::OPTIONS, $this->options)
1355
+				$this->getArray($optionPath.'.'.self::OPTIONS, self::$SQL_PATH),
1356
+				$this->getArray($optionPath.'.'.self::OPTIONS, $this->options)
1357 1357
 			);
1358 1358
 		}
1359 1359
 
1360
-		return $base . '_' . $extension;
1360
+		return $base.'_'.$extension;
1361 1361
 	}
1362 1362
 
1363 1363
 
@@ -1377,7 +1377,7 @@  discard block
 block discarded – undo
1377 1377
 			} else {
1378 1378
 				$k = $arr;
1379 1379
 			}
1380
-			$path[$k] = $prefix . '_' . $k . '_';
1380
+			$path[$k] = $prefix.'_'.$k.'_';
1381 1381
 		}
1382 1382
 
1383 1383
 		return $path;
Please login to merge, or discard this patch.
lib/Command/MembersList.php 1 patch
Spacing   +14 added lines, -15 removed lines patch added patch discarded remove patch
@@ -179,11 +179,11 @@  discard block
 block discarded – undo
179 179
 			$this->federatedUserService->commandLineInitiator($initiator, $circleId, true);
180 180
 			$circle = $this->circleService->getCircle($circleId);
181 181
 
182
-			$output->writeln('<info>Name</info>: ' . $circle->getName());
182
+			$output->writeln('<info>Name</info>: '.$circle->getName());
183 183
 			$owner = $circle->getOwner();
184
-			$output->writeln('<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance());
184
+			$output->writeln('<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance());
185 185
 			$type = implode(", ", Circle::getCircleFlags($circle, Circle::FLAGS_LONG));
186
-			$output->writeln('<info>Config</info>: ' . $type);
186
+			$output->writeln('<info>Config</info>: '.$type);
187 187
 			$output->writeln(' ');
188 188
 
189 189
 			$tree = new NC22TreeNode(null, new SimpleDataStore(['circle' => $circle]));
@@ -247,8 +247,7 @@  discard block
 block discarded – undo
247 247
 					($this->input->getOption('display-name')) ?
248 248
 						$member->getBasedOn()->getDisplayName() : $member->getUserId(),
249 249
 					$this->configService->displayInstance($member->getInstance()),
250
-					($level > 0) ? Member::$DEF_LEVEL[$level] :
251
-						'(' . strtolower($member->getStatus()) . ')'
250
+					($level > 0) ? Member::$DEF_LEVEL[$level] : '('.strtolower($member->getStatus()).')'
252 251
 				]
253 252
 			);
254 253
 		}
@@ -389,18 +388,18 @@  discard block
 block discarded – undo
389 388
 				$member = $data->gObj('member', Member::class);
390 389
 
391 390
 				if ($lineNumber === 1) {
392
-					$line .= '<info>' . $member->getSingleId() . '</info>';
391
+					$line .= '<info>'.$member->getSingleId().'</info>';
393 392
 					if (!$this->configService->isLocalInstance($member->getInstance())) {
394
-						$line .= '@' . $member->getInstance();
393
+						$line .= '@'.$member->getInstance();
395 394
 					}
396
-					$line .= ' (' . Member::$DEF_LEVEL[$member->getLevel()] . ')';
395
+					$line .= ' ('.Member::$DEF_LEVEL[$member->getLevel()].')';
397 396
 
398
-					$line .= ' <info>MemberId</info>: ' . $member->getId();
397
+					$line .= ' <info>MemberId</info>: '.$member->getId();
399 398
 					$name = ($this->input->getOption('display-name')) ?
400 399
 						$member->getBasedOn()->getDisplayName() : $member->getUserId();
401
-					$line .= ' <info>Name</info>: ' . $name;
400
+					$line .= ' <info>Name</info>: '.$name;
402 401
 					$source = ($member->hasBasedOn()) ? $member->getBasedOn()->getSource() : '';
403
-					$line .= ' <info>Source</info>: ' . Circle::$DEF_SOURCE[$source];
402
+					$line .= ' <info>Source</info>: '.Circle::$DEF_SOURCE[$source];
404 403
 				}
405 404
 
406 405
 				if ($lineNumber === 2) {
@@ -412,16 +411,16 @@  discard block
 block discarded – undo
412 411
 						return $line;
413 412
 					}
414 413
 					$owner = $circle->getOwner();
415
-					$line .= '<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance();
414
+					$line .= '<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance();
416 415
 					$type = implode(", ", Circle::getCircleFlags($circle, Circle::FLAGS_LONG));
417
-					$line .= ($type === '') ? '' : ' <info>Config</info>: ' . $type;
416
+					$line .= ($type === '') ? '' : ' <info>Config</info>: '.$type;
418 417
 				}
419 418
 
420 419
 			} else {
421 420
 				if ($lineNumber === 1 && !is_null($circle)) {
422
-					$line .= '<info>' . $circle->getSingleId() . '</info>';
421
+					$line .= '<info>'.$circle->getSingleId().'</info>';
423 422
 					if (!$this->configService->isLocalInstance($circle->getInstance())) {
424
-						$line .= '@' . $circle->getInstance();
423
+						$line .= '@'.$circle->getInstance();
425 424
 					}
426 425
 				}
427 426
 			}
Please login to merge, or discard this patch.