Completed
Pull Request — master (#551)
by Maxence
02:04
created
lib/FederatedItems/MemberAdd.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 			$this->sendMailExistingShares($template, $author, $recipient);
178 178
 			$this->sendPasswordExistingShares($author, $recipient, $password);
179 179
 		} catch (Exception $e) {
180
-			$this->miscService->log('Failed to send mail about existing share ' . $e->getMessage());
180
+			$this->miscService->log('Failed to send mail about existing share '.$e->getMessage());
181 181
 		}
182 182
 	}
183 183
 
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 		$authorName = ($authorUser instanceof IUser) ? $authorUser->getDisplayName() : $author;
328 328
 		$authorEmail = ($authorUser instanceof IUser) ? $authorUser->getEMailAddress() : null;
329 329
 
330
-		$this->miscService->log("Sending password mail about existing files to '" . $email . "'", 0);
330
+		$this->miscService->log("Sending password mail about existing files to '".$email."'", 0);
331 331
 
332 332
 		$plainBodyPart = $this->l10n->t(
333 333
 			"%1\$s shared multiple files with you.\nYou should have already received a separate mail with a link to access them.\n",
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
 		$message->setFrom([\OCP\Util::getDefaultEmailAddress($instanceName) => $senderName]);
370 370
 		if ($authorEmail !== null) {
371 371
 			$message->setReplyTo([$authorEmail => $authorName]);
372
-			$emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan());
372
+			$emailTemplate->addFooter($instanceName.' - '.$this->defaults->getSlogan());
373 373
 		} else {
374 374
 			$emailTemplate->addFooter();
375 375
 		}
Please login to merge, or discard this patch.
lib/Service/FederatedEventService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -238,16 +238,16 @@
 block discarded – undo
238 238
 		try {
239 239
 			$test = new ReflectionClass($class);
240 240
 		} catch (ReflectionException $e) {
241
-			throw new FederatedEventException('ReflectionException with ' . $class . ': ' . $e->getMessage());
241
+			throw new FederatedEventException('ReflectionException with '.$class.': '.$e->getMessage());
242 242
 		}
243 243
 
244 244
 		if (!in_array(IFederatedItem::class, $test->getInterfaceNames())) {
245
-			throw new FederatedEventException($class . ' does not implements IFederatedItem');
245
+			throw new FederatedEventException($class.' does not implements IFederatedItem');
246 246
 		}
247 247
 
248 248
 		$item = OC::$server->get($class);
249 249
 		if (!($item instanceof IFederatedItem)) {
250
-			throw new FederatedEventException($class . ' not an IFederatedItem');
250
+			throw new FederatedEventException($class.' not an IFederatedItem');
251 251
 		}
252 252
 
253 253
 		$this->setFederatedEventBypass($event, $item);
Please login to merge, or discard this patch.
lib/Command/MembersAdd.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -119,12 +119,12 @@  discard block
 block discarded – undo
119 119
 		$userType = $input->getOption('type');
120 120
 
121 121
 		//
122
-		$this->federatedUserService->commandLineInitiator($input->getOption('initiator'), $circleId,  false);
122
+		$this->federatedUserService->commandLineInitiator($input->getOption('initiator'), $circleId, false);
123 123
 
124 124
 		$member = $this->federatedUserService->createFederatedUser($userId, (int)$userType);
125 125
 		$outcome = $this->memberService->addMember($circleId, $member);
126 126
 
127
-		echo json_encode($outcome, JSON_PRETTY_PRINT) . "\n";
127
+		echo json_encode($outcome, JSON_PRETTY_PRINT)."\n";
128 128
 
129 129
 		return 0;
130 130
 	}
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
 				$instance = $host;
176 176
 			}
177 177
 
178
-			$result[] = $user['userid']['value'] . ' <info>@' . $host . '</info>';
178
+			$result[] = $user['userid']['value'].' <info>@'.$host.'</info>';
179 179
 		}
180 180
 
181 181
 //		if ($userId === '') {
Please login to merge, or discard this patch.
lib/Model/Circle.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -78,22 +78,22 @@  discard block
 block discarded – undo
78 78
 
79 79
 
80 80
 	// specific value
81
-	const CFG_CIRCLE = 0;        // only for code readability. Circle is locked by default.
82
-	const CFG_SINGLE = 1;        // Circle with only one single member.
83
-	const CFG_PERSONAL = 2;      // Personal circle, only the owner can see it.
81
+	const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default.
82
+	const CFG_SINGLE = 1; // Circle with only one single member.
83
+	const CFG_PERSONAL = 2; // Personal circle, only the owner can see it.
84 84
 
85 85
 	// bitwise
86
-	const CFG_VISIBLE = 8;        // Visible to everyone, if not visible, people have to know its name to be able to find it
87
-	const CFG_OPEN = 16;          // Circle is open, people can join
88
-	const CFG_INVITE = 32;        // Adding a member generate an invitation that needs to be accepted
89
-	const CFG_REQUEST = 64;       // Request to join Circles needs to be confirmed by a moderator
90
-	const CFG_FRIEND = 128;       // Members of the circle can invite their friends
91
-	const CFG_PROTECTED = 256;    // Password protected to join/request
92
-	const CFG_NO_OWNER = 512;     // no owner, only members
93
-	const CFG_HIDDEN = 1024;      // hidden from listing, but available as a share entity
94
-	const CFG_BACKEND = 2048;     // Fully hidden, only backend Circles
95
-	const CFG_ROOT = 4096;        // Circle cannot be inside another Circle
96
-	const CFG_FEDERATED = 8192;   // Federated
86
+	const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it
87
+	const CFG_OPEN = 16; // Circle is open, people can join
88
+	const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted
89
+	const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator
90
+	const CFG_FRIEND = 128; // Members of the circle can invite their friends
91
+	const CFG_PROTECTED = 256; // Password protected to join/request
92
+	const CFG_NO_OWNER = 512; // no owner, only members
93
+	const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity
94
+	const CFG_BACKEND = 2048; // Fully hidden, only backend Circles
95
+	const CFG_ROOT = 4096; // Circle cannot be inside another Circle
96
+	const CFG_FEDERATED = 8192; // Federated
97 97
 
98 98
 	static $DEF = [
99 99
 		1 => 'S|Single',
@@ -583,21 +583,21 @@  discard block
 block discarded – undo
583 583
 	 * @throws CircleNotFoundException
584 584
 	 */
585 585
 	public function importFromDatabase(array $data, string $prefix = ''): INC21QueryRow {
586
-		if (!array_key_exists($prefix . 'unique_id', $data)) {
586
+		if (!array_key_exists($prefix.'unique_id', $data)) {
587 587
 			throw new CircleNotFoundException();
588 588
 		}
589 589
 
590
-		$this->setId($this->get($prefix . 'unique_id', $data))
591
-			 ->setName($this->get($prefix . 'name', $data))
592
-			 ->setAltName($this->get($prefix . 'alt_name', $data))
593
-			 ->setConfig($this->getInt($prefix . 'config', $data))
594
-			 ->setInstance($this->get($prefix . 'instance', $data))
595
-			 ->setSettings($this->getArray($prefix . 'settings', $data))
596
-			 ->setContactAddressBook($this->getInt($prefix . 'contact_addressbook', $data))
597
-			 ->setContactGroupName($this->get($prefix . 'contact_groupname', $data))
598
-			 ->setDescription($this->get($prefix . 'description', $data));
599
-
600
-		$creation = $this->get($prefix . 'creation', $data);
590
+		$this->setId($this->get($prefix.'unique_id', $data))
591
+			 ->setName($this->get($prefix.'name', $data))
592
+			 ->setAltName($this->get($prefix.'alt_name', $data))
593
+			 ->setConfig($this->getInt($prefix.'config', $data))
594
+			 ->setInstance($this->get($prefix.'instance', $data))
595
+			 ->setSettings($this->getArray($prefix.'settings', $data))
596
+			 ->setContactAddressBook($this->getInt($prefix.'contact_addressbook', $data))
597
+			 ->setContactGroupName($this->get($prefix.'contact_groupname', $data))
598
+			 ->setDescription($this->get($prefix.'description', $data));
599
+
600
+		$creation = $this->get($prefix.'creation', $data);
601 601
 		$this->setCreation(DateTime::createFromFormat('Y-m-d H:i:s', $creation)->getTimestamp());
602 602
 
603 603
 		$this->getManager()->importOwnerFromDatabase($this, $data);
Please login to merge, or discard this patch.
lib/Model/Helpers/MemberHelper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 		try {
105 105
 			$level = Member::parseLevelString($levelString);
106 106
 		} catch (MemberLevelException $e) {
107
-			throw new MemberHelperException('method ' . $levelString . ' not found');
107
+			throw new MemberHelperException('method '.$levelString.' not found');
108 108
 		}
109 109
 
110 110
 		$this->mustHaveLevelEqualOrAbove($level);
@@ -122,11 +122,11 @@  discard block
 block discarded – undo
122 122
 		try {
123 123
 			$level = Member::parseLevelString($levelString);
124 124
 		} catch (MemberLevelException $e) {
125
-			throw new MemberHelperException('method ' . $levelString . ' not found');
125
+			throw new MemberHelperException('method '.$levelString.' not found');
126 126
 		}
127 127
 
128 128
 		if ($this->member->getLevel() >= $level) {
129
-			throw new MemberLevelException('Member cannot be ' . $levelString);
129
+			throw new MemberLevelException('Member cannot be '.$levelString);
130 130
 		}
131 131
 	}
132 132
 
Please login to merge, or discard this patch.
lib/Command/MembersLevel.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@
 block discarded – undo
108 108
 		$level = Member::parseLevelString($input->getArgument('level'));
109 109
 		$outcome = $this->memberService->memberLevel($memberId, $level);
110 110
 
111
-		echo json_encode($outcome, JSON_PRETTY_PRINT) . "\n";
111
+		echo json_encode($outcome, JSON_PRETTY_PRINT)."\n";
112 112
 
113 113
 		return 0;
114 114
 	}
Please login to merge, or discard this patch.
lib/Command/MembersRemove.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@
 block discarded – undo
106 106
 
107 107
 		$outcome = $this->memberService->removeMember($memberId);
108 108
 
109
-		echo json_encode($outcome, JSON_PRETTY_PRINT) . "\n";
109
+		echo json_encode($outcome, JSON_PRETTY_PRINT)."\n";
110 110
 
111 111
 		return 0;
112 112
 	}
Please login to merge, or discard this patch.
lib/Service/FederatedUserService.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	public function createLocalFederatedUser(string $userId): FederatedUser {
180 180
 		$user = $this->userManager->get($userId);
181 181
 		if ($user === null) {
182
-			throw new NoUserException('user ' . $userId . ' not found');
182
+			throw new NoUserException('user '.$userId.' not found');
183 183
 		}
184 184
 
185 185
 		$federatedUser = new FederatedUser();
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 			$circle = new Circle();
331 331
 			$id = $this->token(ManagedModel::ID_LENGTH);
332 332
 
333
-			$circle->setName('single:' . $federatedUser->getUserId() . ':' . $id)
333
+			$circle->setName('single:'.$federatedUser->getUserId().':'.$id)
334 334
 				   ->setId($id)
335 335
 				   ->setConfig(Circle::CFG_SINGLE);
336 336
 			$this->circleRequest->save($circle);
@@ -391,8 +391,8 @@  discard block
 block discarded – undo
391 391
 
392 392
 		$last = $this->generateMemberships($federatedUser);
393 393
 
394
-		echo 'known: ' . json_encode($federatedUser->getMemberships()) . "\n";
395
-		echo 'last: ' . json_encode($last) . "\n";
394
+		echo 'known: '.json_encode($federatedUser->getMemberships())."\n";
395
+		echo 'last: '.json_encode($last)."\n";
396 396
 
397 397
 //
398 398
 //		$circles = $this->circleRequest->getCircles(null, $viewer);
Please login to merge, or discard this patch.
lib/Service/RemoteService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -189,7 +189,7 @@
 block discarded – undo
189 189
 			$loop++;
190 190
 			if ($loop > 10 || in_array($instance, $knownInstance)) {
191 191
 				throw new CircleNotFoundException(
192
-					'circle not found after browsing ' . implode(', ', $knownInstance)
192
+					'circle not found after browsing '.implode(', ', $knownInstance)
193 193
 				);
194 194
 			}
195 195
 			$knownInstance[] = $instance;
Please login to merge, or discard this patch.