Cancelled
Pull Request — master (#643)
by René
31s
created
lib/FederatedItems/SingleMemberAdd.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -336,11 +336,11 @@  discard block
 block discarded – undo
336 336
 	protected function generateMember(FederatedEvent $event, Circle $circle, Member $member): Member {
337 337
 		try {
338 338
 			if ($member->getSingleId() !== '') {
339
-				$userId = $member->getSingleId() . '@' . $member->getInstance();
339
+				$userId = $member->getSingleId().'@'.$member->getInstance();
340 340
 				$federatedUser = $this->federatedUserService->getFederatedUser($userId, Member::TYPE_SINGLE);
341 341
 
342 342
 			} else {
343
-				$userId = $member->getUserId() . '@' . $member->getInstance();
343
+				$userId = $member->getUserId().'@'.$member->getInstance();
344 344
 				$federatedUser = $this->federatedUserService->getFederatedUser(
345 345
 					$userId,
346 346
 					$member->getUserType()
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
 			$this->sendMailExistingShares($template, $author, $recipient);
643 643
 			$this->sendPasswordExistingShares($author, $recipient, $password);
644 644
 		} catch (Exception $e) {
645
-			$this->miscService->log('Failed to send mail about existing share ' . $e->getMessage());
645
+			$this->miscService->log('Failed to send mail about existing share '.$e->getMessage());
646 646
 		}
647 647
 	}
648 648
 
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
 		$authorName = ($authorUser instanceof IUser) ? $authorUser->getDisplayName() : $author;
795 795
 		$authorEmail = ($authorUser instanceof IUser) ? $authorUser->getEMailAddress() : null;
796 796
 
797
-		$this->miscService->log("Sending password mail about existing files to '" . $email . "'", 0);
797
+		$this->miscService->log("Sending password mail about existing files to '".$email."'", 0);
798 798
 
799 799
 		$plainBodyPart = $this->l10n->t(
800 800
 			"%1\$s shared multiple files with you.\nYou should have already received a separate email with a link to access them.\n",
@@ -836,7 +836,7 @@  discard block
 block discarded – undo
836 836
 		$message->setFrom([\OCP\Util::getDefaultEmailAddress($instanceName) => $senderName]);
837 837
 		if ($authorEmail !== null) {
838 838
 			$message->setReplyTo([$authorEmail => $authorName]);
839
-			$emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan());
839
+			$emailTemplate->addFooter($instanceName.' - '.$this->defaults->getSlogan());
840 840
 		} else {
841 841
 			$emailTemplate->addFooter();
842 842
 		}
Please login to merge, or discard this patch.
lib/Service/CircleService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -496,7 +496,7 @@  discard block
 block discarded – undo
496 496
 
497 497
 		$i = 1;
498 498
 		while (true) {
499
-			$testDisplayName = $baseDisplayName . (($i > 1) ? ' (' . $i . ')' : '');
499
+			$testDisplayName = $baseDisplayName.(($i > 1) ? ' ('.$i.')' : '');
500 500
 			$test = new Circle();
501 501
 			$test->setDisplayName($testDisplayName);
502 502
 
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
 
530 530
 		$i = 1;
531 531
 		while (true) {
532
-			$testSanitizedName = $baseSanitizedName . (($i > 1) ? ' (' . $i . ')' : '');
532
+			$testSanitizedName = $baseSanitizedName.(($i > 1) ? ' ('.$i.')' : '');
533 533
 
534 534
 			$test = new Circle();
535 535
 			$test->setSanitizedName($testSanitizedName);
Please login to merge, or discard this patch.
lib/Listeners/Examples/ExampleAddingCircleMember.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -89,12 +89,12 @@  discard block
 block discarded – undo
89 89
 
90 90
 		$eventType = ($event->getType() === CircleGenericEvent::INVITED) ? 'invited' : 'joined';
91 91
 
92
-		$info = 'A new member have been added (' . $eventType . ') to a Circle. ';
92
+		$info = 'A new member have been added ('.$eventType.') to a Circle. ';
93 93
 
94
-		$info .= 'userId: ' . $member->getUserId() . '; userType: ' . Member::$TYPE[$member->getUserType()]
95
-				 . '; singleId: ' . $member->getSingleId() . '; memberId: ' . $member->getId()
96
-				 . '; isLocal: ' . json_encode($member->isLocal()) . '; level: '
97
-				 . Member::$DEF_LEVEL[$member->getLevel()] . '; ';
94
+		$info .= 'userId: '.$member->getUserId().'; userType: '.Member::$TYPE[$member->getUserType()]
95
+				 . '; singleId: '.$member->getSingleId().'; memberId: '.$member->getId()
96
+				 . '; isLocal: '.json_encode($member->isLocal()).'; level: '
97
+				 . Member::$DEF_LEVEL[$member->getLevel()].'; ';
98 98
 
99 99
 		$memberships = array_map(
100 100
 			function(Membership $membership) {
@@ -103,22 +103,22 @@  discard block
 block discarded – undo
103 103
 		);
104 104
 
105 105
 		$listMemberships = (count($memberships) > 0) ? implode(', ', $memberships) : 'none';
106
-		$info .= 'circleName: ' . $circle->getDisplayName() . '; circleId: ' . $circle->getSingleId()
107
-				 . '; Circle memberships: ' . $listMemberships . '.';
106
+		$info .= 'circleName: '.$circle->getDisplayName().'; circleId: '.$circle->getSingleId()
107
+				 . '; Circle memberships: '.$listMemberships.'.';
108 108
 
109 109
 		if ($member->getUserType() === Member::TYPE_CIRCLE) {
110 110
 			$basedOn = $member->getBasedOn();
111 111
 			$members = array_map(
112 112
 				function(Member $member) {
113
-					return $member->getUserId() . ' (' . Member::$TYPE[$member->getUserType()] . ')';
113
+					return $member->getUserId().' ('.Member::$TYPE[$member->getUserType()].')';
114 114
 				}, $basedOn->getInheritedMembers()
115 115
 			);
116 116
 
117
-			$info .= ' Member is a Circle (singleId: ' . $basedOn->getSingleId()
118
-					 . ') that contains those inherited members: ' . implode(', ', $members);
117
+			$info .= ' Member is a Circle (singleId: '.$basedOn->getSingleId()
118
+					 . ') that contains those inherited members: '.implode(', ', $members);
119 119
 		}
120 120
 
121
-		$this->log(3, $prefix . $info);
121
+		$this->log(3, $prefix.$info);
122 122
 	}
123 123
 
124 124
 }
Please login to merge, or discard this patch.
lib/Listeners/Examples/ExampleRequestingCircleMember.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -91,11 +91,11 @@
 block discarded – undo
91 91
 
92 92
 		$circle = $event->getCircle();
93 93
 		$member = $event->getMember();
94
-		$info .= 'circleId: ' . $circle->getSingleId() . '; userId: ' . $member->getUserId() . '; userType: '
95
-				 . Member::$TYPE[$member->getUserType()] . '; singleId: ' . $member->getSingleId()
96
-				 . '; memberId: ' . $member->getId() . '; isLocal: ' . json_encode($member->isLocal()) . '; ';
94
+		$info .= 'circleId: '.$circle->getSingleId().'; userId: '.$member->getUserId().'; userType: '
95
+				 . Member::$TYPE[$member->getUserType()].'; singleId: '.$member->getSingleId()
96
+				 . '; memberId: '.$member->getId().'; isLocal: '.json_encode($member->isLocal()).'; ';
97 97
 
98
-		$this->log(3, $prefix . $info);
98
+		$this->log(3, $prefix.$info);
99 99
 	}
100 100
 
101 101
 }
Please login to merge, or discard this patch.
lib/Db/MemberRequest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -239,8 +239,8 @@  discard block
 block discarded – undo
239 239
 			$qb->filterDirectMembership(CoreQueryBuilder::MEMBER, $filter);
240 240
 		}
241 241
 
242
-		$qb->orderBy($qb->getDefaultSelectAlias() . '.level', 'desc');
243
-		$qb->addOrderBy($qb->getDefaultSelectAlias() . '.cached_name', 'asc');
242
+		$qb->orderBy($qb->getDefaultSelectAlias().'.level', 'desc');
243
+		$qb->addOrderBy($qb->getDefaultSelectAlias().'.cached_name', 'asc');
244 244
 
245 245
 		return $this->getItemsFromRequest($qb);
246 246
 	}
@@ -265,8 +265,8 @@  discard block
 block discarded – undo
265 265
 		$qb->limitToMembersByInheritance(CoreQueryBuilder::MEMBER, $singleId, $level);
266 266
 
267 267
 		$aliasMembership = $qb->generateAlias(CoreQueryBuilder::MEMBER, CoreQueryBuilder::MEMBERSHIPS);
268
-		$qb->orderBy($aliasMembership . '.inheritance_depth', 'asc')
269
-		   ->addGroupBy($aliasMembership . '.inheritance_depth');
268
+		$qb->orderBy($aliasMembership.'.inheritance_depth', 'asc')
269
+		   ->addGroupBy($aliasMembership.'.inheritance_depth');
270 270
 
271 271
 		return $this->getItemsFromRequest($qb);
272 272
 	}
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 		$qb = $this->getMemberSelectSql();
309 309
 		$qb->limitToCircleId($circleId);
310 310
 
311
-		$qb->andwhere($qb->expr()->nonEmptyString(CoreQueryBuilder::MEMBER . '.instance'));
311
+		$qb->andwhere($qb->expr()->nonEmptyString(CoreQueryBuilder::MEMBER.'.instance'));
312 312
 
313 313
 		return array_map(
314 314
 			function(Member $member): string {
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 	 */
362 362
 	public function searchFederatedUsers(string $needle): array {
363 363
 		$qb = $this->getMemberSelectSql();
364
-		$qb->searchInDBField('user_id', '%' . $needle . '%');
364
+		$qb->searchInDBField('user_id', '%'.$needle.'%');
365 365
 
366 366
 		return $this->getItemsFromRequest($qb, true);
367 367
 	}
Please login to merge, or discard this patch.
lib/Service/ConfigService.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 			return $value;
187 187
 		}
188 188
 
189
-		if (($value = $this->config->getSystemValue(Application::APP_ID . '.' . $key, '')) !== '') {
189
+		if (($value = $this->config->getSystemValue(Application::APP_ID.'.'.$key, '')) !== '') {
190 190
 			return $value;
191 191
 		}
192 192
 
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 		}
441 441
 
442 442
 		if (array_key_exists('port', $loopback)) {
443
-			$loopbackCloudId = $loopback['host'] . ':' . $loopback['port'];
443
+			$loopbackCloudId = $loopback['host'].':'.$loopback['port'];
444 444
 		} else {
445 445
 			$loopbackCloudId = $loopback['host'];
446 446
 		}
@@ -469,12 +469,12 @@  discard block
 block discarded – undo
469 469
 			$scheme = $this->getAppValue(self::LOOPBACK_CLOUD_SCHEME);
470 470
 		}
471 471
 
472
-		$base = $scheme . '://' . $instance;
472
+		$base = $scheme.'://'.$instance;
473 473
 		if ($route === '') {
474 474
 			return $base;
475 475
 		}
476 476
 
477
-		return $base . $this->urlGenerator->linkToRoute($route, $args);
477
+		return $base.$this->urlGenerator->linkToRoute($route, $args);
478 478
 	}
479 479
 
480 480
 
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
 	public function displayFederatedUser(IFederatedUser $federatedUser, bool $displayName = false): string {
575 575
 		$name = ($displayName) ? $federatedUser->getDisplayName() : $federatedUser->getUserId();
576 576
 
577
-		return $name . $this->displayInstance($federatedUser->getInstance(), true);
577
+		return $name.$this->displayInstance($federatedUser->getInstance(), true);
578 578
 	}
579 579
 
580 580
 	/**
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
 			return '';
589 589
 		}
590 590
 
591
-		return (($showAt) ? '@' : '') . $instance;
591
+		return (($showAt) ? '@' : '').$instance;
592 592
 	}
593 593
 
594 594
 
Please login to merge, or discard this patch.
lib/Model/Circle.php 1 patch
Spacing   +33 added lines, -33 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
 
@@ -763,24 +763,24 @@  discard block
 block discarded – undo
763 763
 	 * @throws CircleNotFoundException
764 764
 	 */
765 765
 	public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow {
766
-		if ($this->get($prefix . 'unique_id', $data) === '') {
766
+		if ($this->get($prefix.'unique_id', $data) === '') {
767 767
 			throw new CircleNotFoundException();
768 768
 		}
769 769
 
770
-		$this->setSingleId($this->get($prefix . 'unique_id', $data))
771
-			 ->setName($this->get($prefix . 'name', $data))
772
-			 ->setDisplayName($this->get($prefix . 'display_name', $data))
773
-			 ->setSanitizedName($this->get($prefix . 'sanitized_name', $data))
774
-			 ->setConfig($this->getInt($prefix . 'config', $data))
775
-			 ->setSource($this->getInt($prefix . 'source', $data))
776
-			 ->setInstance($this->get($prefix . 'instance', $data))
777
-			 ->setPopulation($this->getInt($prefix . 'population', $data))
778
-			 ->setSettings($this->getArray($prefix . 'settings', $data))
779
-			 ->setContactAddressBook($this->getInt($prefix . 'contact_addressbook', $data))
780
-			 ->setContactGroupName($this->get($prefix . 'contact_groupname', $data))
781
-			 ->setDescription($this->get($prefix . 'description', $data));
782
-
783
-		$creation = $this->get($prefix . 'creation', $data);
770
+		$this->setSingleId($this->get($prefix.'unique_id', $data))
771
+			 ->setName($this->get($prefix.'name', $data))
772
+			 ->setDisplayName($this->get($prefix.'display_name', $data))
773
+			 ->setSanitizedName($this->get($prefix.'sanitized_name', $data))
774
+			 ->setConfig($this->getInt($prefix.'config', $data))
775
+			 ->setSource($this->getInt($prefix.'source', $data))
776
+			 ->setInstance($this->get($prefix.'instance', $data))
777
+			 ->setPopulation($this->getInt($prefix.'population', $data))
778
+			 ->setSettings($this->getArray($prefix.'settings', $data))
779
+			 ->setContactAddressBook($this->getInt($prefix.'contact_addressbook', $data))
780
+			 ->setContactGroupName($this->get($prefix.'contact_groupname', $data))
781
+			 ->setDescription($this->get($prefix.'description', $data));
782
+
783
+		$creation = $this->get($prefix.'creation', $data);
784 784
 		$this->setCreation(DateTime::createFromFormat('Y-m-d H:i:s', $creation)->getTimestamp());
785 785
 
786 786
 		$this->getManager()->manageImportFromDatabase($this, $data, $prefix);
Please login to merge, or discard this patch.
lib/Service/SyncService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
 	 * @throws SingleCircleNotFoundException
251 251
 	 */
252 252
 	public function syncNextcloudUser(string $userId): FederatedUser {
253
-		$this->outputService->output('Syncing Nextcloud User \'' . $userId . '\'', true);
253
+		$this->outputService->output('Syncing Nextcloud User \''.$userId.'\'', true);
254 254
 
255 255
 		return $this->federatedUserService->getLocalFederatedUser($userId);
256 256
 	}
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 	 * @throws RequestBuilderException
295 295
 	 */
296 296
 	public function syncNextcloudGroup(string $groupId): Circle {
297
-		$this->outputService->output('Syncing Nextcloud Group \'' . $groupId . '\'', true);
297
+		$this->outputService->output('Syncing Nextcloud Group \''.$groupId.'\'', true);
298 298
 
299 299
 		$circle = $this->federatedUserService->getGroupCircle($groupId);
300 300
 		$group = $this->groupManager->get($groupId);
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 	 */
364 364
 	public function groupDeleted(string $groupId): void {
365 365
 		$circle = new Circle();
366
-		$circle->setName('group:' . $groupId)
366
+		$circle->setName('group:'.$groupId)
367 367
 			   ->setConfig(Circle::CFG_SYSTEM | Circle::CFG_NO_OWNER | Circle::CFG_HIDDEN)
368 368
 			   ->setSource(Member::TYPE_GROUP);
369 369
 
Please login to merge, or discard this patch.
lib/Service/OutputService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -82,14 +82,14 @@
 block discarded – undo
82 82
 	 */
83 83
 	public function output(string $message, bool $advance = false): void {
84 84
 		if (!is_null($this->occOutput)) {
85
-			$this->occOutput->writeln((($advance) ? '+' : '-') . ' ' . $message);
85
+			$this->occOutput->writeln((($advance) ? '+' : '-').' '.$message);
86 86
 		}
87 87
 
88 88
 		if (!is_null($this->migrationOutput)) {
89 89
 			if ($advance) {
90
-				$this->migrationOutput->advance(1, '(Circles) ' . $message);
90
+				$this->migrationOutput->advance(1, '(Circles) '.$message);
91 91
 			} else {
92
-				$this->migrationOutput->info('(Circles) ' . $message);
92
+				$this->migrationOutput->info('(Circles) '.$message);
93 93
 			}
94 94
 		}
95 95
 	}
Please login to merge, or discard this patch.