Completed
Pull Request — master (#603)
by John
02:40
created
lib/Command/CirclesEdit.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@
 block discarded – undo
125 125
 		} catch (FederatedItemException $e) {
126 126
 			if ($input->getOption('status-code')) {
127 127
 				throw new FederatedItemException(
128
-					' [' . get_class($e) . ', ' . $e->getStatus() . ']' . "\n" . $e->getMessage()
128
+					' ['.get_class($e).', '.$e->getStatus().']'."\n".$e->getMessage()
129 129
 				);
130 130
 			}
131 131
 
Please login to merge, or discard this patch.
lib/Model/Circle.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
 
359 359
 
360 360
 	/**
361
-	 * @param ?Member $owner
361
+	 * @param Member $owner
362 362
 	 *
363 363
 	 * @return self
364 364
 	 */
@@ -414,7 +414,7 @@  discard block
 block discarded – undo
414 414
 
415 415
 
416 416
 	/**
417
-	 * @param array $members
417
+	 * @param Member[] $members
418 418
 	 * @param bool $detailed
419 419
 	 *
420 420
 	 * @return self
Please login to merge, or discard this 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/CircleProviderRequest.php 1 patch
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -40,10 +40,10 @@
 block discarded – undo
40 40
 
41 41
 
42 42
 	/**
43
-	 * @param $userId
43
+	 * @param string $userId
44 44
 	 * @param $circleUniqueIds
45
-	 * @param $limit
46
-	 * @param $offset
45
+	 * @param integer $limit
46
+	 * @param integer $offset
47 47
 	 *
48 48
 	 * @return array
49 49
 	 * @throws GSStatusException
Please login to merge, or discard this patch.
lib/Db/GSSharesRequestBuilder.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,6 @@
 block discarded – undo
35 35
 
36 36
 
37 37
 /** * @deprecated
38
-
39 38
  * Class GSSharesRequestBuilder
40 39
  *
41 40
  * @package OCA\Circles\Db
Please login to merge, or discard this patch.
lib/Db/CircleRequestBuilder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@
 block discarded – undo
77 77
 		$qb = $this->getQueryBuilder();
78 78
 		$qb->generateSelect(self::TABLE_CIRCLE, self::$tables[self::TABLE_CIRCLE], $alias, true)
79 79
 		   ->generateGroupBy(self::$tables[self::TABLE_CIRCLE], $alias)
80
-		   ->orderBy($alias . '.creation', 'asc');
80
+		   ->orderBy($alias.'.creation', 'asc');
81 81
 
82 82
 		return $qb;
83 83
 	}
Please login to merge, or discard this patch.
lib/Db/RemoteRequest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -182,10 +182,10 @@  discard block
 block discarded – undo
182 182
 			$qb->leftJoin(
183 183
 				CoreQueryBuilder::REMOTE, self::TABLE_MEMBER, $aliasMember,
184 184
 				$expr->andX(
185
-					$expr->eq($aliasMember . '.circle_id', $qb->createNamedParameter($circle->getSingleId())),
186
-					$expr->eq($aliasMember . '.instance', CoreQueryBuilder::REMOTE . '.instance'),
185
+					$expr->eq($aliasMember.'.circle_id', $qb->createNamedParameter($circle->getSingleId())),
186
+					$expr->eq($aliasMember.'.instance', CoreQueryBuilder::REMOTE.'.instance'),
187 187
 					$expr->gte(
188
-						$aliasMember . '.level',
188
+						$aliasMember.'.level',
189 189
 						$qb->createNamedParameter(Member::LEVEL_MEMBER, IQueryBuilder::PARAM_INT)
190 190
 					)
191 191
 				)
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 
194 194
 			$external = $expr->andX();
195 195
 			$external->add($qb->exprLimitToDBField('type', RemoteInstance::TYPE_EXTERNAL, true, false));
196
-			$external->add($expr->isNotNull($aliasMember . '.instance'));
196
+			$external->add($expr->isNotNull($aliasMember.'.instance'));
197 197
 			$orX->add($external);
198 198
 		}
199 199
 
Please login to merge, or discard this patch.
lib/Db/MemberRequestBuilder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
 			CoreQueryBuilder::MEMBER
90 90
 		)
91 91
 		   ->generateGroupBy(self::$tables[self::TABLE_MEMBER], CoreQueryBuilder::MEMBER)
92
-		   ->orderBy(CoreQueryBuilder::MEMBER . '.joined');
92
+		   ->orderBy(CoreQueryBuilder::MEMBER.'.joined');
93 93
 
94 94
 		if ($getBasedOn) {
95 95
 			$qb->leftJoinBasedOn(CoreQueryBuilder::MEMBER, $initiator);
Please login to merge, or discard this patch.
lib/Command/CirclesReport.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 	 * @return string[]
219 219
 	 */
220 220
 	public function fillCommandList(string $source, string $field): array {
221
-		echo $source . ' ' . $field . "\n";
221
+		echo $source.' '.$field."\n";
222 222
 
223 223
 		return ['abcd', 'abdde', 'erfg'];
224 224
 	}
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 	 * @return string
395 395
 	 */
396 396
 	private function obfuscateId(string $id): string {
397
-		return substr($id, 0, 5) . '.' . md5(substr($id, 5));
397
+		return substr($id, 0, 5).'.'.md5(substr($id, 5));
398 398
 	}
399 399
 
400 400
 
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 	 */
404 404
 	public function onNewPrompt(NC22InteractiveShellSession $session): void {
405 405
 		$prompt =
406
-			'Circles Report [<info>' . $this->report->getSource() . '</info>]:<comment>%PATH%</comment>';
406
+			'Circles Report [<info>'.$this->report->getSource().'</info>]:<comment>%PATH%</comment>';
407 407
 
408 408
 		$commands = [];
409 409
 		if ($session->getData()->g('currentStatus') === 'write') {
Please login to merge, or discard this patch.
lib/Command/CirclesCheck.php 2 patches
Doc Comments   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 	 * CirclesCheck constructor.
111 111
 	 *
112 112
 	 * @param Capabilities $capabilities
113
-	 * @param FederatedEvent $federatedEventService
113
+	 * @param FederatedEventService $federatedEventService
114 114
 	 * @param RemoteService $remoteService
115 115
 	 * @param RemoteStreamService $remoteStreamService
116 116
 	 * @param RemoteUpstreamService $remoteUpstreamService
@@ -619,7 +619,6 @@  discard block
 block discarded – undo
619 619
 
620 620
 
621 621
 	/**
622
-	 * @param OutputInterface $o
623 622
 	 * @param string $type
624 623
 	 * @param string $route
625 624
 	 * @param array $args
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 			throw new Exception('Please specify a --type for the test');
174 174
 		}
175 175
 		if ($test !== '' && !in_array($type, self::$checks)) {
176
-			throw new Exception('Unknown type: ' . implode(', ', self::$checks));
176
+			throw new Exception('Unknown type: '.implode(', ', self::$checks));
177 177
 		}
178 178
 
179 179
 //		$this->configService->setAppValue(ConfigService::TEST_NC_BASE, $test);
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 		}
279 279
 
280 280
 		$output->writeln('');
281
-		$output->writeln('* testing current address: ' . $test);
281
+		$output->writeln('* testing current address: '.$test);
282 282
 
283 283
 		try {
284 284
 			$this->setupLoopback($input, $output, $test);
@@ -314,8 +314,8 @@  discard block
 block discarded – undo
314 314
 				continue;
315 315
 			}
316 316
 
317
-			$loopback = $scheme . '://' . $cloudId;
318
-			$output->write('* testing address: ' . $loopback . ' ');
317
+			$loopback = $scheme.'://'.$cloudId;
318
+			$output->write('* testing address: '.$loopback.' ');
319 319
 
320 320
 			if ($this->testLoopback($input, $output, $loopback)) {
321 321
 				$output->writeln('* <info>Loopback</info> address looks good');
@@ -385,9 +385,9 @@  discard block
 block discarded – undo
385 385
 		$test = new FederatedEvent(LoopbackTest::class);
386 386
 		$this->federatedEventService->newEvent($test);
387 387
 
388
-		$output->writeln('<info>' . $test->getWrapperToken() . '</info>');
388
+		$output->writeln('<info>'.$test->getWrapperToken().'</info>');
389 389
 
390
-		$output->writeln('- Waiting for async process to finish (' . $this->delay . 's)');
390
+		$output->writeln('- Waiting for async process to finish ('.$this->delay.'s)');
391 391
 		sleep($this->delay);
392 392
 
393 393
 		$output->write('- Checking status on FederatedEvent ');
@@ -401,18 +401,18 @@  discard block
 block discarded – undo
401 401
 
402 402
 		$checkVerify = $wrapper->getEvent()->getData()->gInt('verify');
403 403
 		if ($checkVerify === LoopbackTest::VERIFY) {
404
-			$output->write('<info>verify=' . $checkVerify . '</info> ');
404
+			$output->write('<info>verify='.$checkVerify.'</info> ');
405 405
 		} else {
406
-			$output->writeln('<error>verify=' . $checkVerify . '</error>');
406
+			$output->writeln('<error>verify='.$checkVerify.'</error>');
407 407
 
408 408
 			return false;
409 409
 		}
410 410
 
411 411
 		$checkManage = $wrapper->getResult()->gInt('manage');
412 412
 		if ($checkManage === LoopbackTest::MANAGE) {
413
-			$output->write('<info>manage=' . $checkManage . '</info> ');
413
+			$output->write('<info>manage='.$checkManage.'</info> ');
414 414
 		} else {
415
-			$output->writeln('<error>manage=' . $checkManage . '</error>');
415
+			$output->writeln('<error>manage='.$checkManage.'</error>');
416 416
 
417 417
 			return false;
418 418
 		}
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
 		[$scheme, $cloudId] = $this->parseAddress($loopback);
435 435
 
436 436
 		$question = new ConfirmationQuestion(
437
-			'- Do you want to save <info>'. $loopback . '</info> as your <info>loopback</info> address ? (y/N) ', false, '/^(y|Y)/i'
437
+			'- Do you want to save <info>'.$loopback.'</info> as your <info>loopback</info> address ? (y/N) ', false, '/^(y|Y)/i'
438 438
 		);
439 439
 
440 440
 		$helper = $this->getHelper('question');
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 		$this->configService->setAppValue(ConfigService::LOOPBACK_CLOUD_SCHEME, $scheme);
448 448
 		$this->configService->setAppValue(ConfigService::LOOPBACK_CLOUD_ID, $cloudId);
449 449
 		$output->writeln(
450
-			'- Address <info>' . $loopback . '</info> is now used as <info>loopback</info>'
450
+			'- Address <info>'.$loopback.'</info> is now used as <info>loopback</info>'
451 451
 		);
452 452
 
453 453
 	}
@@ -518,7 +518,7 @@  discard block
 block discarded – undo
518 518
 				continue;
519 519
 			}
520 520
 
521
-			$frontal = $scheme . '://' . $cloudId;
521
+			$frontal = $scheme.'://'.$cloudId;
522 522
 			break;
523 523
 		}
524 524
 
@@ -532,13 +532,13 @@  discard block
 block discarded – undo
532 532
 				'You will need to run this <info>curl</info> command from a remote terminal and paste its result: '
533 533
 			);
534 534
 			$output->writeln(
535
-				'     curl ' . $frontal . '/.well-known/webfinger?resource=http://nextcloud.com/'
535
+				'     curl '.$frontal.'/.well-known/webfinger?resource=http://nextcloud.com/'
536 536
 			);
537 537
 
538 538
 			$question = new Question('result: ', '');
539 539
 			$pasteWebfinger = $helper->ask($input, $output, $question);
540 540
 
541
-			echo '__ ' . $pasteWebfinger;
541
+			echo '__ '.$pasteWebfinger;
542 542
 
543 543
 			$output->writeln('TESTING !!');
544 544
 			$output->writeln('TESTING !!');
@@ -661,7 +661,7 @@  discard block
 block discarded – undo
661 661
 		$this->configService->configureLoopbackRequest($request, $route, $args);
662 662
 		$request->setFollowLocation(false);
663 663
 
664
-		$output->write('- ' . $type . ' request on ' . $request->getCompleteUrl() . ': ');
664
+		$output->write('- '.$type.' request on '.$request->getCompleteUrl().': ');
665 665
 
666 666
 		try {
667 667
 			$this->doRequest($request);
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 				$color = 'info';
673 673
 			}
674 674
 
675
-			$output->writeln('<' . $color . '>' . $result->getStatusCode() . '</' . $color . '>');
675
+			$output->writeln('<'.$color.'>'.$result->getStatusCode().'</'.$color.'>');
676 676
 			if ($result->getStatusCode() === 200) {
677 677
 				return true;
678 678
 			}
@@ -696,7 +696,7 @@  discard block
 block discarded – undo
696 696
 
697 697
 		$output->writeln('');
698 698
 		$output->writeln(
699
-			'The address <info>' . $address . '</info> seems to reach your local Nextcloud.'
699
+			'The address <info>'.$address.'</info> seems to reach your local Nextcloud.'
700 700
 		);
701 701
 
702 702
 		$helper = $this->getHelper('question');
@@ -713,8 +713,8 @@  discard block
 block discarded – undo
713 713
 
714 714
 		$this->configService->setAppValue(ConfigService::FORCE_NC_BASE, $address);
715 715
 		$output->writeln(
716
-			'New configuration <info>' . Application::APP_ID . '.' . ConfigService::FORCE_NC_BASE . '=\''
717
-			. $address . '\'</info> stored in database'
716
+			'New configuration <info>'.Application::APP_ID.'.'.ConfigService::FORCE_NC_BASE.'=\''
717
+			. $address.'\'</info> stored in database'
718 718
 		);
719 719
 	}
720 720
 
@@ -735,7 +735,7 @@  discard block
 block discarded – undo
735 735
 		}
736 736
 
737 737
 		if (!is_null($cloudIdPort)) {
738
-			$cloudId = $cloudId . ':' . $cloudIdPort;
738
+			$cloudId = $cloudId.':'.$cloudIdPort;
739 739
 		}
740 740
 
741 741
 		return [$scheme, $cloudId];
Please login to merge, or discard this patch.