Completed
Pull Request — master (#625)
by Maxence
02:28
created
lib/Service/ConfigService.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 			return $value;
177 177
 		}
178 178
 
179
-		if (($value = $this->config->getSystemValue(Application::APP_ID . '.' . $key, '')) !== '') {
179
+		if (($value = $this->config->getSystemValue(Application::APP_ID.'.'.$key, '')) !== '') {
180 180
 			return $value;
181 181
 		}
182 182
 
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
 		}
431 431
 
432 432
 		if (array_key_exists('port', $loopback)) {
433
-			$loopbackCloudId = $loopback['host'] . ':' . $loopback['port'];
433
+			$loopbackCloudId = $loopback['host'].':'.$loopback['port'];
434 434
 		} else {
435 435
 			$loopbackCloudId = $loopback['host'];
436 436
 		}
@@ -459,12 +459,12 @@  discard block
 block discarded – undo
459 459
 			$scheme = $this->getAppValue(self::LOOPBACK_CLOUD_SCHEME);
460 460
 		}
461 461
 
462
-		$base = $scheme . '://' . $instance;
462
+		$base = $scheme.'://'.$instance;
463 463
 		if ($route === '') {
464 464
 			return $base;
465 465
 		}
466 466
 
467
-		return $base . $this->urlGenerator->linkToRoute($route, $args);
467
+		return $base.$this->urlGenerator->linkToRoute($route, $args);
468 468
 	}
469 469
 
470 470
 
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
 	 * @return string
562 562
 	 */
563 563
 	public function displayFederatedUser(IFederatedUser $federatedUser): string {
564
-		return $federatedUser->getUserId() . $this->displayInstance($federatedUser->getInstance(), true);
564
+		return $federatedUser->getUserId().$this->displayInstance($federatedUser->getInstance(), true);
565 565
 	}
566 566
 
567 567
 	/**
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
 			return '';
576 576
 		}
577 577
 
578
-		return (($showAt) ? '@' : '') . $instance;
578
+		return (($showAt) ? '@' : '').$instance;
579 579
 	}
580 580
 
581 581
 
Please login to merge, or discard this patch.
lib/Model/Circle.php 1 patch
Spacing   +32 added lines, -32 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
 
@@ -742,23 +742,23 @@  discard block
 block discarded – undo
742 742
 	 * @throws CircleNotFoundException
743 743
 	 */
744 744
 	public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow {
745
-		if ($this->get($prefix . 'unique_id', $data) === '') {
745
+		if ($this->get($prefix.'unique_id', $data) === '') {
746 746
 			throw new CircleNotFoundException();
747 747
 		}
748 748
 
749
-		$this->setSingleId($this->get($prefix . 'unique_id', $data))
750
-			 ->setName($this->get($prefix . 'name', $data))
751
-			 ->setDisplayName($this->get($prefix . 'display_name', $data))
752
-			 ->setSanitizedName($this->get($prefix . 'sanitized_name', $data))
753
-			 ->setConfig($this->getInt($prefix . 'config', $data))
754
-			 ->setSource($this->getInt($prefix . 'source', $data))
755
-			 ->setInstance($this->get($prefix . 'instance', $data))
756
-			 ->setSettings($this->getArray($prefix . 'settings', $data))
757
-			 ->setContactAddressBook($this->getInt($prefix . 'contact_addressbook', $data))
758
-			 ->setContactGroupName($this->get($prefix . 'contact_groupname', $data))
759
-			 ->setDescription($this->get($prefix . 'description', $data));
760
-
761
-		$creation = $this->get($prefix . 'creation', $data);
749
+		$this->setSingleId($this->get($prefix.'unique_id', $data))
750
+			 ->setName($this->get($prefix.'name', $data))
751
+			 ->setDisplayName($this->get($prefix.'display_name', $data))
752
+			 ->setSanitizedName($this->get($prefix.'sanitized_name', $data))
753
+			 ->setConfig($this->getInt($prefix.'config', $data))
754
+			 ->setSource($this->getInt($prefix.'source', $data))
755
+			 ->setInstance($this->get($prefix.'instance', $data))
756
+			 ->setSettings($this->getArray($prefix.'settings', $data))
757
+			 ->setContactAddressBook($this->getInt($prefix.'contact_addressbook', $data))
758
+			 ->setContactGroupName($this->get($prefix.'contact_groupname', $data))
759
+			 ->setDescription($this->get($prefix.'description', $data));
760
+
761
+		$creation = $this->get($prefix.'creation', $data);
762 762
 		$this->setCreation(DateTime::createFromFormat('Y-m-d H:i:s', $creation)->getTimestamp());
763 763
 
764 764
 		$this->getManager()->manageImportFromDatabase($this, $data, $prefix);
Please login to merge, or discard this patch.
lib/Service/MaintenanceService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@
 block discarded – undo
169 169
 	 */
170 170
 	private function output(string $message): void {
171 171
 		if (!is_null($this->output)) {
172
-			$this->output->writeln('- ' . $message);
172
+			$this->output->writeln('- '.$message);
173 173
 		}
174 174
 	}
175 175
 
Please login to merge, or discard this patch.
lib/Model/FederatedUser.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -400,15 +400,15 @@
 block discarded – undo
400 400
 	 * @throws FederatedUserNotFoundException
401 401
 	 */
402 402
 	public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow {
403
-		if ($this->get($prefix . 'single_id', $data) === '') {
403
+		if ($this->get($prefix.'single_id', $data) === '') {
404 404
 			throw new FederatedUserNotFoundException();
405 405
 		}
406 406
 
407
-		$this->setSingleId($this->get($prefix . 'single_id', $data));
408
-		$this->setUserId($this->get($prefix . 'user_id', $data));
409
-		$this->setUserType($this->getInt($prefix . 'user_type', $data));
410
-		$this->setDisplayName($this->get($prefix . 'cached_name', $data));
411
-		$this->setInstance($this->get($prefix . 'instance', $data));
407
+		$this->setSingleId($this->get($prefix.'single_id', $data));
408
+		$this->setUserId($this->get($prefix.'user_id', $data));
409
+		$this->setUserType($this->getInt($prefix.'user_type', $data));
410
+		$this->setDisplayName($this->get($prefix.'cached_name', $data));
411
+		$this->setInstance($this->get($prefix.'instance', $data));
412 412
 
413 413
 		$this->getManager()->manageImportFromDatabase($this, $data, $prefix);
414 414
 
Please login to merge, or discard this patch.
lib/Model/Federated/RemoteInstance.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 
51 51
 	use TArrayTools;
52 52
 
53
-	const TYPE_UNKNOWN = 'Unknown';    // not trusted
54
-	const TYPE_PASSIVE = 'Passive';    // Minimum information about Federated Circles are broadcasted if a member belongs to the circle.
55
-	const TYPE_EXTERNAL = 'External';  // info about Federated Circles and their members are broadcasted  if a member belongs to the circle.
56
-	const TYPE_TRUSTED = 'Trusted';    // everything about Federated Circles are broadcasted.
57
-	const TYPE_GLOBALSCALE = 'GlobalScale';  // every Circle is broadcasted,
53
+	const TYPE_UNKNOWN = 'Unknown'; // not trusted
54
+	const TYPE_PASSIVE = 'Passive'; // Minimum information about Federated Circles are broadcasted if a member belongs to the circle.
55
+	const TYPE_EXTERNAL = 'External'; // info about Federated Circles and their members are broadcasted  if a member belongs to the circle.
56
+	const TYPE_TRUSTED = 'Trusted'; // everything about Federated Circles are broadcasted.
57
+	const TYPE_GLOBALSCALE = 'GlobalScale'; // every Circle is broadcasted,
58 58
 
59 59
 	public static $LIST_TYPE = [
60 60
 		self::TYPE_UNKNOWN,
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 		];
478 478
 
479 479
 		if ($this->getAuthSigned() !== '') {
480
-			$data['auth-signed'] = $this->getAlgorithm() . ':' . $this->getAuthSigned();
480
+			$data['auth-signed'] = $this->getAlgorithm().':'.$this->getAuthSigned();
481 481
 		}
482 482
 
483 483
 		if (!empty($this->getAliases())) {
@@ -496,17 +496,17 @@  discard block
 block discarded – undo
496 496
 	 * @throws RemoteNotFoundException
497 497
 	 */
498 498
 	public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow {
499
-		if ($this->getInt($prefix . 'id', $data) === 0) {
499
+		if ($this->getInt($prefix.'id', $data) === 0) {
500 500
 			throw new RemoteNotFoundException();
501 501
 		}
502 502
 
503
-		$this->setDbId($this->getInt($prefix . 'id', $data));
504
-		$this->import($this->getArray($prefix . 'item', $data));
505
-		$this->setOrigData($this->getArray($prefix . 'item', $data));
506
-		$this->setType($this->get($prefix . 'type', $data));
507
-		$this->setInterface($this->getInt($prefix . 'interface', $data));
508
-		$this->setInstance($this->get($prefix . 'instance', $data));
509
-		$this->setId($this->get($prefix . 'href', $data));
503
+		$this->setDbId($this->getInt($prefix.'id', $data));
504
+		$this->import($this->getArray($prefix.'item', $data));
505
+		$this->setOrigData($this->getArray($prefix.'item', $data));
506
+		$this->setType($this->get($prefix.'type', $data));
507
+		$this->setInterface($this->getInt($prefix.'interface', $data));
508
+		$this->setInstance($this->get($prefix.'instance', $data));
509
+		$this->setId($this->get($prefix.'href', $data));
510 510
 
511 511
 		return $this;
512 512
 	}
Please login to merge, or discard this patch.
lib/Service/FederatedUserService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 		if ($check) {
395 395
 			$user = $this->userManager->get($userId);
396 396
 			if ($user === null) {
397
-				throw new FederatedUserNotFoundException('user ' . $userId . ' not found');
397
+				throw new FederatedUserNotFoundException('user '.$userId.' not found');
398 398
 			}
399 399
 			$userId = $user->getUID();
400 400
 			$displayName = $user->getDisplayName();
@@ -852,7 +852,7 @@  discard block
 block discarded – undo
852 852
 			$prefix = ($federatedUser->getUserType() === Member::TYPE_APP) ? 'app'
853 853
 				: Member::$TYPE[$federatedUser->getUserType()];
854 854
 
855
-			$circle->setName($prefix . ':' . $federatedUser->getUserId() . ':' . $id)
855
+			$circle->setName($prefix.':'.$federatedUser->getUserId().':'.$id)
856 856
 				   ->setDisplayName($federatedUser->getDisplayName())
857 857
 				   ->setSingleId($id)
858 858
 				   ->setSource($source);
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
 		$owner = $this->getCurrentApp();
977 977
 
978 978
 		$circle = new Circle();
979
-		$circle->setName('group:' . $groupId)
979
+		$circle->setName('group:'.$groupId)
980 980
 			   ->setConfig(Circle::CFG_SYSTEM | Circle::CFG_NO_OWNER | Circle::CFG_HIDDEN)
981 981
 			   ->setSingleId($this->token(ManagedModel::ID_LENGTH))
982 982
 			   ->setSource(Member::TYPE_GROUP);
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
@@ -186,11 +186,11 @@  discard block
 block discarded – undo
186 186
 			$this->federatedUserService->commandLineInitiator($initiator, $initiatorType, $circleId, true);
187 187
 			$circle = $this->circleService->getCircle($circleId);
188 188
 
189
-			$output->writeln('<info>Name</info>: ' . $circle->getName());
189
+			$output->writeln('<info>Name</info>: '.$circle->getName());
190 190
 			$owner = $circle->getOwner();
191
-			$output->writeln('<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance());
191
+			$output->writeln('<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance());
192 192
 			$type = implode(", ", Circle::getCircleFlags($circle, Circle::FLAGS_LONG));
193
-			$output->writeln('<info>Config</info>: ' . $type);
193
+			$output->writeln('<info>Config</info>: '.$type);
194 194
 			$output->writeln(' ');
195 195
 
196 196
 			$tree = new NC22TreeNode(null, new SimpleDataStore(['circle' => $circle]));
@@ -254,8 +254,7 @@  discard block
 block discarded – undo
254 254
 					($this->input->getOption('display-name')) ?
255 255
 						$member->getDisplayName() : $member->getUserId(),
256 256
 					$this->configService->displayInstance($member->getInstance()),
257
-					($level > 0) ? Member::$DEF_LEVEL[$level] :
258
-						'(' . strtolower($member->getStatus()) . ')',
257
+					($level > 0) ? Member::$DEF_LEVEL[$level] : '('.strtolower($member->getStatus()).')',
259 258
 					($member->hasInvitedBy()) ? $this->configService->displayFederatedUser(
260 259
 						$member->getInvitedBy()
261 260
 					) : 'Unknown'
@@ -417,18 +416,18 @@  discard block
 block discarded – undo
417 416
 				$member = $data->gObj('member', Member::class);
418 417
 
419 418
 				if ($lineNumber === 1) {
420
-					$line .= '<info>' . $member->getSingleId() . '</info>';
419
+					$line .= '<info>'.$member->getSingleId().'</info>';
421 420
 					if (!$this->configService->isLocalInstance($member->getInstance())) {
422
-						$line .= '@' . $member->getInstance();
421
+						$line .= '@'.$member->getInstance();
423 422
 					}
424
-					$line .= ' (' . Member::$DEF_LEVEL[$member->getLevel()] . ')';
423
+					$line .= ' ('.Member::$DEF_LEVEL[$member->getLevel()].')';
425 424
 
426
-					$line .= ' <info>MemberId</info>: ' . $member->getId();
425
+					$line .= ' <info>MemberId</info>: '.$member->getId();
427 426
 					$name = ($this->input->getOption('display-name')) ?
428 427
 						$member->getDisplayName() : $member->getUserId();
429
-					$line .= ' <info>Name</info>: ' . $name;
428
+					$line .= ' <info>Name</info>: '.$name;
430 429
 					$source = ($member->hasBasedOn()) ? $member->getBasedOn()->getSource() : '';
431
-					$line .= ' <info>Source</info>: ' . Circle::$DEF_SOURCE[$source];
430
+					$line .= ' <info>Source</info>: '.Circle::$DEF_SOURCE[$source];
432 431
 				}
433 432
 
434 433
 				if ($lineNumber === 2) {
@@ -440,16 +439,16 @@  discard block
 block discarded – undo
440 439
 						return $line;
441 440
 					}
442 441
 					$owner = $circle->getOwner();
443
-					$line .= '<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance();
442
+					$line .= '<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance();
444 443
 					$type = implode(", ", Circle::getCircleFlags($circle, Circle::FLAGS_LONG));
445
-					$line .= ($type === '') ? '' : ' <info>Config</info>: ' . $type;
444
+					$line .= ($type === '') ? '' : ' <info>Config</info>: '.$type;
446 445
 				}
447 446
 
448 447
 			} else {
449 448
 				if ($lineNumber === 1 && !is_null($circle)) {
450
-					$line .= '<info>' . $circle->getSingleId() . '</info>';
449
+					$line .= '<info>'.$circle->getSingleId().'</info>';
451 450
 					if (!$this->configService->isLocalInstance($circle->getInstance())) {
452
-						$line .= '@' . $circle->getInstance();
451
+						$line .= '@'.$circle->getInstance();
453 452
 					}
454 453
 				}
455 454
 			}
Please login to merge, or discard this patch.
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/Command/CirclesMaintenance.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
 				'<error>WARNING! You are about to delete all data related to the Circles App!</error>'
109 109
 			);
110 110
 			$question = new ConfirmationQuestion(
111
-				'<comment>Do you really want to ' . $action . ' Circles ?</comment> (y/N) ', false, '/^(y|Y)/i'
111
+				'<comment>Do you really want to '.$action.' Circles ?</comment> (y/N) ', false, '/^(y|Y)/i'
112 112
 			);
113 113
 
114 114
 			$helper = $this->getHelper('question');
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
 
125 125
 			$question = new Question(
126
-				'<comment>Please confirm this destructive operation by typing \'' . $action
126
+				'<comment>Please confirm this destructive operation by typing \''.$action
127 127
 				. '\'</comment>: ', ''
128 128
 			);
129 129
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 				$this->coreQueryBuilder->uninstall();
141 141
 			}
142 142
 
143
-			$output->writeln('<info>' . $action . ' done</info>');
143
+			$output->writeln('<info>'.$action.' done</info>');
144 144
 
145 145
 			return 0;
146 146
 		}
Please login to merge, or discard this patch.