Completed
Pull Request — master (#842)
by Joas
40s
created
lib/Command/MembersList.php 1 patch
Spacing   +14 added lines, -15 removed lines patch added patch discarded remove patch
@@ -187,11 +187,11 @@  discard block
 block discarded – undo
187 187
 			$this->federatedUserService->commandLineInitiator($initiator, $initiatorType, $circleId, true);
188 188
 			$circle = $this->circleService->getCircle($circleId);
189 189
 
190
-			$output->writeln('<info>Name</info>: ' . $circle->getName());
190
+			$output->writeln('<info>Name</info>: '.$circle->getName());
191 191
 			$owner = $circle->getOwner();
192
-			$output->writeln('<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance());
192
+			$output->writeln('<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance());
193 193
 			$type = implode(", ", Circle::getCircleFlags($circle, Circle::FLAGS_LONG));
194
-			$output->writeln('<info>Config</info>: ' . $type);
194
+			$output->writeln('<info>Config</info>: '.$type);
195 195
 			$output->writeln(' ');
196 196
 
197 197
 			$tree = new NC22TreeNode(null, new SimpleDataStore(['circle' => $circle]));
@@ -258,8 +258,7 @@  discard block
 block discarded – undo
258 258
 						), 40
259 259
 					),
260 260
 					$this->configService->displayInstance($member->getInstance()),
261
-					($level > 0) ? Member::$DEF_LEVEL[$level] :
262
-						'(' . strtolower($member->getStatus()) . ')',
261
+					($level > 0) ? Member::$DEF_LEVEL[$level] : '('.strtolower($member->getStatus()).')',
263 262
 					($member->hasInvitedBy()) ? $this->configService->displayFederatedUser(
264 263
 						$member->getInvitedBy(), $this->input->getOption('display-name')
265 264
 					) : 'Unknown'
@@ -424,14 +423,14 @@  discard block
 block discarded – undo
424 423
 				$member = $data->gObj('member', Member::class);
425 424
 
426 425
 				if ($lineNumber === 1) {
427
-					$line .= '<info>' . $member->getSingleId() . '</info>';
426
+					$line .= '<info>'.$member->getSingleId().'</info>';
428 427
 					if (!$this->configService->isLocalInstance($member->getInstance())) {
429
-						$line .= '@' . $member->getInstance();
428
+						$line .= '@'.$member->getInstance();
430 429
 					}
431
-					$line .= ' (' . Member::$DEF_LEVEL[$member->getLevel()] . ')';
430
+					$line .= ' ('.Member::$DEF_LEVEL[$member->getLevel()].')';
432 431
 
433
-					$line .= ' <info>MemberId</info>: ' . $member->getId();
434
-					$line .= ' <info>Name</info>: ' . $this->configService->displayFederatedUser(
432
+					$line .= ' <info>MemberId</info>: '.$member->getId();
433
+					$line .= ' <info>Name</info>: '.$this->configService->displayFederatedUser(
435 434
 							$member,
436 435
 							$this->input->getOption('display-name')
437 436
 						);
@@ -439,7 +438,7 @@  discard block
 block discarded – undo
439 438
 						$line .= ' <info>Source</info>: '
440 439
 								 . Circle::$DEF_SOURCE[$member->getBasedOn()->getSource()];
441 440
 					} else {
442
-						$line .= ' <info>Type</info>: ' . Member::$TYPE[$member->getUserType()];
441
+						$line .= ' <info>Type</info>: '.Member::$TYPE[$member->getUserType()];
443 442
 					}
444 443
 				}
445 444
 
@@ -452,15 +451,15 @@  discard block
 block discarded – undo
452 451
 						return $line;
453 452
 					}
454 453
 					$owner = $circle->getOwner();
455
-					$line .= '<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance();
454
+					$line .= '<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance();
456 455
 					$type = implode(", ", Circle::getCircleFlags($circle, Circle::FLAGS_LONG));
457
-					$line .= ($type === '') ? '' : ' <info>Config</info>: ' . $type;
456
+					$line .= ($type === '') ? '' : ' <info>Config</info>: '.$type;
458 457
 				}
459 458
 			} else {
460 459
 				if ($lineNumber === 1 && !is_null($circle)) {
461
-					$line .= '<info>' . $circle->getSingleId() . '</info>';
460
+					$line .= '<info>'.$circle->getSingleId().'</info>';
462 461
 					if (!$this->configService->isLocalInstance($circle->getInstance())) {
463
-						$line .= '@' . $circle->getInstance();
462
+						$line .= '@'.$circle->getInstance();
464 463
 					}
465 464
 				}
466 465
 			}
Please login to merge, or discard this patch.
lib/Service/InterfaceService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -409,12 +409,12 @@  discard block
 block discarded – undo
409 409
 			throw new UnknownInterfaceException('misconfigured scheme');
410 410
 		}
411 411
 
412
-		$base = $scheme . '://' . $this->getCloudInstance($interface) . $path;
412
+		$base = $scheme.'://'.$this->getCloudInstance($interface).$path;
413 413
 		if ($route === '') {
414 414
 			return $base;
415 415
 		}
416 416
 
417
-		return $base . $this->configService->linkToRoute($route, $args);
417
+		return $base.$this->configService->linkToRoute($route, $args);
418 418
 	}
419 419
 
420 420
 
@@ -447,7 +447,7 @@  discard block
 block discarded – undo
447 447
 			return $this->configService->getLoopbackPath($route, $args);
448 448
 		}
449 449
 
450
-		return rtrim($base, '/') . $this->configService->linkToRoute($route, $args);
450
+		return rtrim($base, '/').$this->configService->linkToRoute($route, $args);
451 451
 	}
452 452
 
453 453
 
Please login to merge, or discard this patch.
lib/Command/CirclesCheck.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 			throw new Exception('Please specify a --type for the test');
178 178
 		}
179 179
 		if ($test !== '' && !in_array($type, self::$checks)) {
180
-			throw new Exception('Unknown type: ' . implode(', ', self::$checks));
180
+			throw new Exception('Unknown type: '.implode(', ', self::$checks));
181 181
 		}
182 182
 
183 183
 //		$this->configService->setAppValue(ConfigService::TEST_NC_BASE, $test);
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
 		}
236 236
 
237 237
 		$output->writeln('');
238
-		$output->writeln('* testing current address: ' . $test);
238
+		$output->writeln('* testing current address: '.$test);
239 239
 
240 240
 		try {
241 241
 			$this->setupLoopback($input, $output, $test);
@@ -271,8 +271,8 @@  discard block
 block discarded – undo
271 271
 				continue;
272 272
 			}
273 273
 
274
-			$loopback = rtrim($scheme . '://' . $cloudId . $path, '/');
275
-			$output->writeln('* testing address: ' . $loopback . ' ');
274
+			$loopback = rtrim($scheme.'://'.$cloudId.$path, '/');
275
+			$output->writeln('* testing address: '.$loopback.' ');
276 276
 
277 277
 			try {
278 278
 				$this->setupLoopback($input, $output, $loopback);
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 		$test = new FederatedEvent(LoopbackTest::class);
345 345
 		$this->federatedEventService->newEvent($test);
346 346
 
347
-		$output->writeln('<info>' . $test->getWrapperToken() . '</info>');
347
+		$output->writeln('<info>'.$test->getWrapperToken().'</info>');
348 348
 
349 349
 		$output->writeln('- Waiting for async process to finish (5s)');
350 350
 		sleep(5);
@@ -359,18 +359,18 @@  discard block
 block discarded – undo
359 359
 
360 360
 		$checkVerify = $wrapper->getEvent()->getData()->gInt('verify');
361 361
 		if ($checkVerify === LoopbackTest::VERIFY) {
362
-			$output->write('<info>verify=' . $checkVerify . '</info> ');
362
+			$output->write('<info>verify='.$checkVerify.'</info> ');
363 363
 		} else {
364
-			$output->writeln('<error>verify=' . $checkVerify . '</error>');
364
+			$output->writeln('<error>verify='.$checkVerify.'</error>');
365 365
 
366 366
 			return false;
367 367
 		}
368 368
 
369 369
 		$checkManage = $wrapper->getResult()->gInt('manage');
370 370
 		if ($checkManage === LoopbackTest::MANAGE) {
371
-			$output->write('<info>manage=' . $checkManage . '</info> ');
371
+			$output->write('<info>manage='.$checkManage.'</info> ');
372 372
 		} else {
373
-			$output->writeln('<error>manage=' . $checkManage . '</error>');
373
+			$output->writeln('<error>manage='.$checkManage.'</error>');
374 374
 
375 375
 			return false;
376 376
 		}
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
 		[$scheme, $cloudId, $path] = $this->parseAddress($loopback);
393 393
 
394 394
 		$question = new ConfirmationQuestion(
395
-			'- Do you want to save <info>' . $loopback
395
+			'- Do you want to save <info>'.$loopback
396 396
 			. '</info> as your <info>loopback</info> address ? (y/N) ', false, '/^(y|Y)/i'
397 397
 		);
398 398
 
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
 		$this->configService->setAppValue(ConfigService::LOOPBACK_CLOUD_ID, $cloudId);
408 408
 		$this->configService->setAppValue(ConfigService::LOOPBACK_CLOUD_PATH, $path);
409 409
 		$output->writeln(
410
-			'- Address <info>' . $loopback . '</info> is now used as <info>loopback</info>'
410
+			'- Address <info>'.$loopback.'</info> is now used as <info>loopback</info>'
411 411
 		);
412 412
 	}
413 413
 
@@ -459,8 +459,8 @@  discard block
 block discarded – undo
459 459
 				continue;
460 460
 			}
461 461
 
462
-			$internal = rtrim($scheme . '://' . $cloudId, '/');
463
-			$fullInternal = rtrim($scheme . '://' . $cloudId . $path, '/');
462
+			$internal = rtrim($scheme.'://'.$cloudId, '/');
463
+			$fullInternal = rtrim($scheme.'://'.$cloudId.$path, '/');
464 464
 
465 465
 			$question = new ConfirmationQuestion(
466 466
 				'<comment>Do you want to check the validity of this internal address?</comment> (Y/n) ', true,
@@ -479,9 +479,9 @@  discard block
 block discarded – undo
479 479
 					'You will need to run this <info>curl</info> command from a terminal on your local network and paste its result: '
480 480
 				);
481 481
 				$output->writeln(
482
-					'     curl -L "' . $internal
482
+					'     curl -L "'.$internal
483 483
 					. '/.well-known/webfinger?resource=http://nextcloud.com/&test='
484
-					. $testToken . '"'
484
+					. $testToken.'"'
485 485
 				);
486 486
 
487 487
 				$output->writeln('paste the result here: ');
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
 
516 516
 				if ($pastedHref !== $href) {
517 517
 					$output->writeln(
518
-						'<error>The returned data (' . $pastedHref . ') are not the one expected: </error>'
518
+						'<error>The returned data ('.$pastedHref.') are not the one expected: </error>'
519 519
 						. $href
520 520
 					);
521 521
 					continue;
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
 					'Now, please run this <info>curl</info> command from a terminal on your local network and paste its result: '
528 528
 				);
529 529
 				$output->writeln(
530
-					'     curl -L "' . $pastedHref . '?test=' . $testToken . '" -H "Accept: application/json"'
530
+					'     curl -L "'.$pastedHref.'?test='.$testToken.'" -H "Accept: application/json"'
531 531
 				);
532 532
 
533 533
 				$output->writeln('paste the result here: ');
@@ -544,9 +544,9 @@  discard block
 block discarded – undo
544 544
 					|| $appSignatory->getRoot() !== $pastedSignatory->g('root')) {
545 545
 					$output->writeln(
546 546
 						'<error>The returned data ('
547
-						. $pastedSignatory->g('uid') . '/' . $pastedSignatory->g('root')
547
+						. $pastedSignatory->g('uid').'/'.$pastedSignatory->g('root')
548 548
 						. ') are not the one expected: </error>'
549
-						. $appSignatory->getUid(true) . '/' . $appSignatory->getRoot()
549
+						. $appSignatory->getUid(true).'/'.$appSignatory->getRoot()
550 550
 					);
551 551
 					continue;
552 552
 				}
@@ -573,7 +573,7 @@  discard block
 block discarded – undo
573 573
 
574 574
 		$output->writeln('');
575 575
 		$question = new ConfirmationQuestion(
576
-			'- Do you want to save <info>' . $internal
576
+			'- Do you want to save <info>'.$internal
577 577
 			. '</info> as your <info>internal</info> address ? (y/N) ', false, '/^(y|Y)/i'
578 578
 		);
579 579
 
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
 		$this->configService->setAppValue(ConfigService::INTERNAL_CLOUD_PATH, $path);
590 590
 
591 591
 		$output->writeln(
592
-			'- Address <info>' . $internal . '</info> is now used as <info>internal</info>'
592
+			'- Address <info>'.$internal.'</info> is now used as <info>internal</info>'
593 593
 		);
594 594
 	}
595 595
 
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
 				continue;
643 643
 			}
644 644
 
645
-			$frontal = rtrim($scheme . '://' . $cloudId . $path, '/');
645
+			$frontal = rtrim($scheme.'://'.$cloudId.$path, '/');
646 646
 			break;
647 647
 		}
648 648
 
@@ -656,13 +656,13 @@  discard block
 block discarded – undo
656 656
 				'You will need to run this <info>curl</info> command from a remote terminal and paste its result: '
657 657
 			);
658 658
 			$output->writeln(
659
-				'     curl ' . $frontal . '/.well-known/webfinger?resource=http://nextcloud.com/'
659
+				'     curl '.$frontal.'/.well-known/webfinger?resource=http://nextcloud.com/'
660 660
 			);
661 661
 
662 662
 			$question = new Question('result: ', '');
663 663
 			$pasteWebfinger = $helper->ask($input, $output, $question);
664 664
 
665
-			echo '__ ' . $pasteWebfinger;
665
+			echo '__ '.$pasteWebfinger;
666 666
 
667 667
 			$output->writeln('TESTING !!');
668 668
 			$output->writeln('TESTING !!');
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
 			$request->setDataSerialize(new SimpleDataStore(['empty' => 1]));
790 790
 		}
791 791
 
792
-		$output->write('- ' . $type . ' request on ' . $request->getCompleteUrl() . ': ');
792
+		$output->write('- '.$type.' request on '.$request->getCompleteUrl().': ');
793 793
 
794 794
 		try {
795 795
 			$this->doRequest($request);
@@ -800,7 +800,7 @@  discard block
 block discarded – undo
800 800
 				$color = 'info';
801 801
 			}
802 802
 
803
-			$output->writeln('<' . $color . '>' . $result->getStatusCode() . '</' . $color . '>');
803
+			$output->writeln('<'.$color.'>'.$result->getStatusCode().'</'.$color.'>');
804 804
 			if ($result->getStatusCode() === 200) {
805 805
 				return true;
806 806
 			}
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
 
825 825
 		$output->writeln('');
826 826
 		$output->writeln(
827
-			'The address <info>' . $address . '</info> seems to reach your local Nextcloud.'
827
+			'The address <info>'.$address.'</info> seems to reach your local Nextcloud.'
828 828
 		);
829 829
 
830 830
 		$helper = $this->getHelper('question');
@@ -841,8 +841,8 @@  discard block
 block discarded – undo
841 841
 
842 842
 		$this->configService->setAppValue(ConfigService::FORCE_NC_BASE, $address);
843 843
 		$output->writeln(
844
-			'New configuration <info>' . Application::APP_ID . '.' . ConfigService::FORCE_NC_BASE . '=\''
845
-			. $address . '\'</info> stored in database'
844
+			'New configuration <info>'.Application::APP_ID.'.'.ConfigService::FORCE_NC_BASE.'=\''
845
+			. $address.'\'</info> stored in database'
846 846
 		);
847 847
 	}
848 848
 
@@ -870,7 +870,7 @@  discard block
 block discarded – undo
870 870
 		$path = rtrim($path, '/');
871 871
 
872 872
 		if (!is_null($cloudIdPort)) {
873
-			$cloudId = $cloudId . ':' . $cloudIdPort;
873
+			$cloudId = $cloudId.':'.$cloudIdPort;
874 874
 		}
875 875
 
876 876
 		return [$scheme, $cloudId, $path];
Please login to merge, or discard this patch.
lib/Service/ConfigService.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 			return $value;
224 224
 		}
225 225
 
226
-		if (($value = $this->config->getSystemValue(Application::APP_ID . '.' . $key, '')) !== '') {
226
+		if (($value = $this->config->getSystemValue(Application::APP_ID.'.'.$key, '')) !== '') {
227 227
 			return $value;
228 228
 		}
229 229
 
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 	 */
443 443
 	public function getTrustedDomains(): array {
444 444
 		return array_map(
445
-			function (string $address) {
445
+			function(string $address) {
446 446
 				return strtolower($address);
447 447
 			}, $this->config->getSystemValue('trusted_domains', [])
448 448
 		);
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 		}
479 479
 
480 480
 		if (array_key_exists('port', $loopback)) {
481
-			$loopbackCloudId = $loopback['host'] . ':' . $loopback['port'];
481
+			$loopbackCloudId = $loopback['host'].':'.$loopback['port'];
482 482
 		} else {
483 483
 			$loopbackCloudId = $loopback['host'];
484 484
 		}
@@ -517,13 +517,13 @@  discard block
 block discarded – undo
517 517
 			$path = $this->getAppValue(self::LOOPBACK_CLOUD_PATH);
518 518
 		}
519 519
 
520
-		$base = $scheme . '://' . $instance . $path;
520
+		$base = $scheme.'://'.$instance.$path;
521 521
 
522 522
 		if ($route === '') {
523 523
 			return $base;
524 524
 		}
525 525
 
526
-		return rtrim($base, '/') . $this->linkToRoute($route, $args);
526
+		return rtrim($base, '/').$this->linkToRoute($route, $args);
527 527
 	}
528 528
 
529 529
 
@@ -624,10 +624,10 @@  discard block
 block discarded – undo
624 624
 		$name = ($displayName) ? $federatedUser->getDisplayName() : $federatedUser->getUserId();
625 625
 
626 626
 		if ($federatedUser->getUserType() === Member::TYPE_MAIL) {
627
-			return $name . ' (' . $this->displayInstance($federatedUser->getInstance(), false) . ')';
627
+			return $name.' ('.$this->displayInstance($federatedUser->getInstance(), false).')';
628 628
 		}
629 629
 
630
-		return $name . $this->displayInstance($federatedUser->getInstance(), true);
630
+		return $name.$this->displayInstance($federatedUser->getInstance(), true);
631 631
 	}
632 632
 
633 633
 	/**
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
 			return '';
642 642
 		}
643 643
 
644
-		return (($showAt) ? '@' : '') . $instance;
644
+		return (($showAt) ? '@' : '').$instance;
645 645
 	}
646 646
 
647 647
 
Please login to merge, or discard this patch.
lib/FederatedItems/SingleMemberAdd.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -338,10 +338,10 @@
 block discarded – undo
338 338
 	protected function generateMember(FederatedEvent $event, Circle $circle, Member $member): Member {
339 339
 		try {
340 340
 			if ($member->getSingleId() !== '') {
341
-				$userId = $member->getSingleId() . '@' . $member->getInstance();
341
+				$userId = $member->getSingleId().'@'.$member->getInstance();
342 342
 				$federatedUser = $this->federatedUserService->getFederatedUser($userId, Member::TYPE_SINGLE);
343 343
 			} else {
344
-				$userId = $member->getUserId() . '@' . $member->getInstance();
344
+				$userId = $member->getUserId().'@'.$member->getInstance();
345 345
 				$federatedUser = $this->federatedUserService->getFederatedUser(
346 346
 					$userId,
347 347
 					$member->getUserType()
Please login to merge, or discard this patch.
lib/Model/Circle.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -87,26 +87,26 @@  discard block
 block discarded – undo
87 87
 
88 88
 
89 89
 	// specific value
90
-	public const CFG_CIRCLE = 0;        // only for code readability. Circle is locked by default.
91
-	public const CFG_SINGLE = 1;        // Circle with only one single member.
92
-	public const CFG_PERSONAL = 2;      // Personal circle, only the owner can see it.
90
+	public const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default.
91
+	public const CFG_SINGLE = 1; // Circle with only one single member.
92
+	public const CFG_PERSONAL = 2; // Personal circle, only the owner can see it.
93 93
 
94 94
 	// bitwise
95
-	public const CFG_SYSTEM = 4;            // System Circle (not managed by the official front-end). Meaning some config are limited
96
-	public const CFG_VISIBLE = 8;           // Visible to everyone, if not visible, people have to know its name to be able to find it
97
-	public const CFG_OPEN = 16;             // Circle is open, people can join
98
-	public const CFG_INVITE = 32;           // Adding a member generate an invitation that needs to be accepted
99
-	public const CFG_REQUEST = 64;          // Request to join Circles needs to be confirmed by a moderator
100
-	public const CFG_FRIEND = 128;          // Members of the circle can invite their friends
101
-	public const CFG_PROTECTED = 256;       // Password protected to join/request
102
-	public const CFG_NO_OWNER = 512;        // no owner, only members
103
-	public const CFG_HIDDEN = 1024;         // hidden from listing, but available as a share entity
104
-	public const CFG_BACKEND = 2048;            // Fully hidden, only backend Circles
105
-	public const CFG_LOCAL = 4096;              // Local even on GlobalScale
106
-	public const CFG_ROOT = 8192;               // Circle cannot be inside another Circle
107
-	public const CFG_CIRCLE_INVITE = 16384;     // Circle must confirm when invited in another circle
108
-	public const CFG_FEDERATED = 32768;         // Federated
109
-	public const CFG_MOUNTPOINT = 65536;        // Generate a Files folder for this Circle
95
+	public const CFG_SYSTEM = 4; // System Circle (not managed by the official front-end). Meaning some config are limited
96
+	public const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it
97
+	public const CFG_OPEN = 16; // Circle is open, people can join
98
+	public const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted
99
+	public const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator
100
+	public const CFG_FRIEND = 128; // Members of the circle can invite their friends
101
+	public const CFG_PROTECTED = 256; // Password protected to join/request
102
+	public const CFG_NO_OWNER = 512; // no owner, only members
103
+	public const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity
104
+	public const CFG_BACKEND = 2048; // Fully hidden, only backend Circles
105
+	public const CFG_LOCAL = 4096; // Local even on GlobalScale
106
+	public const CFG_ROOT = 8192; // Circle cannot be inside another Circle
107
+	public const CFG_CIRCLE_INVITE = 16384; // Circle must confirm when invited in another circle
108
+	public const CFG_FEDERATED = 32768; // Federated
109
+	public const CFG_MOUNTPOINT = 65536; // Generate a Files folder for this Circle
110 110
 
111 111
 	public static $DEF_CFG_MAX = 131071;
112 112
 
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 	 */
470 470
 	public function addInheritedMembers(array $members): self {
471 471
 		$knownIds = array_map(
472
-			function (Member $member): string {
472
+			function(Member $member): string {
473 473
 				return $member->getId();
474 474
 			}, $this->inheritedMembers
475 475
 		);
@@ -842,24 +842,24 @@  discard block
 block discarded – undo
842 842
 	 * @throws CircleNotFoundException
843 843
 	 */
844 844
 	public function importFromDatabase(array $data, string $prefix = ''): INC22QueryRow {
845
-		if ($this->get($prefix . 'unique_id', $data) === '') {
845
+		if ($this->get($prefix.'unique_id', $data) === '') {
846 846
 			throw new CircleNotFoundException();
847 847
 		}
848 848
 
849
-		$this->setSingleId($this->get($prefix . 'unique_id', $data))
850
-			 ->setName($this->get($prefix . 'name', $data))
851
-			 ->setDisplayName($this->get($prefix . 'display_name', $data))
852
-			 ->setSanitizedName($this->get($prefix . 'sanitized_name', $data))
853
-			 ->setConfig($this->getInt($prefix . 'config', $data))
854
-			 ->setSource($this->getInt($prefix . 'source', $data))
855
-			 ->setInstance($this->get($prefix . 'instance', $data))
856
-			 ->setPopulation($this->getInt($prefix . 'population', $data))
857
-			 ->setSettings($this->getArray($prefix . 'settings', $data))
858
-			 ->setContactAddressBook($this->getInt($prefix . 'contact_addressbook', $data))
859
-			 ->setContactGroupName($this->get($prefix . 'contact_groupname', $data))
860
-			 ->setDescription($this->get($prefix . 'description', $data));
861
-
862
-		$creation = $this->get($prefix . 'creation', $data);
849
+		$this->setSingleId($this->get($prefix.'unique_id', $data))
850
+			 ->setName($this->get($prefix.'name', $data))
851
+			 ->setDisplayName($this->get($prefix.'display_name', $data))
852
+			 ->setSanitizedName($this->get($prefix.'sanitized_name', $data))
853
+			 ->setConfig($this->getInt($prefix.'config', $data))
854
+			 ->setSource($this->getInt($prefix.'source', $data))
855
+			 ->setInstance($this->get($prefix.'instance', $data))
856
+			 ->setPopulation($this->getInt($prefix.'population', $data))
857
+			 ->setSettings($this->getArray($prefix.'settings', $data))
858
+			 ->setContactAddressBook($this->getInt($prefix.'contact_addressbook', $data))
859
+			 ->setContactGroupName($this->get($prefix.'contact_groupname', $data))
860
+			 ->setDescription($this->get($prefix.'description', $data));
861
+
862
+		$creation = $this->get($prefix.'creation', $data);
863 863
 		$this->setCreation(DateTime::createFromFormat('Y-m-d H:i:s', $creation)->getTimestamp());
864 864
 
865 865
 		$this->getManager()->manageImportFromDatabase($this, $data, $prefix);
Please login to merge, or discard this patch.
lib/Service/MigrationService.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 		$done = [];
240 240
 		foreach ($circles as $circle) {
241 241
 			$this->outputService->output(
242
-				'Caching memberships for Members of \'' . $circle->getDisplayName() . '\'',
242
+				'Caching memberships for Members of \''.$circle->getDisplayName().'\'',
243 243
 				true
244 244
 			);
245 245
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
 				try {
288 288
 					$data = new SimpleDataStore($row);
289 289
 					$this->outputService->output(
290
-						'Migrating Circle \'' . $data->g('name') . '\' (' . $data->g('unique_id') . ')',
290
+						'Migrating Circle \''.$data->g('name').'\' ('.$data->g('unique_id').')',
291 291
 						true
292 292
 					);
293 293
 
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 				try {
392 392
 					$data = new SimpleDataStore($row);
393 393
 					$this->outputService->output(
394
-						'Migrating Member \'' . $data->g('user_id') . '\' from \'' . $data->g('circle_id')
394
+						'Migrating Member \''.$data->g('user_id').'\' from \''.$data->g('circle_id')
395 395
 						. '\'',
396 396
 						true
397 397
 					);
@@ -506,8 +506,8 @@  discard block
 block discarded – undo
506 506
 					$federatedUser =
507 507
 						$this->federatedUserService->getLocalFederatedUser($data->g('share_with'));
508 508
 					$this->outputService->output(
509
-						'Migrating child share #' . $data->gInt('id') . ' owner: ' . $data->g('share_with')
510
-						. ' -> ' . $federatedUser->getSingleId(),
509
+						'Migrating child share #'.$data->gInt('id').' owner: '.$data->g('share_with')
510
+						. ' -> '.$federatedUser->getSingleId(),
511 511
 						true
512 512
 					);
513 513
 
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
 			$addressBook =
579 579
 				$this->contactService->getAddressBoxById($cm, $this->get('addressbook-key', $entry));
580 580
 
581
-			$member->setUserId($userId . '/' . $addressBook->getUri() . '/' . $contactId);
581
+			$member->setUserId($userId.'/'.$addressBook->getUri().'/'.$contactId);
582 582
 		}
583 583
 	}
584 584
 
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
 				try {
614 614
 					$data = new SimpleDataStore($row);
615 615
 					$this->outputService->output(
616
-						'Migrating ShareToken \'' . $data->g('token') . '\' for \'' . $data->g('user_id')
616
+						'Migrating ShareToken \''.$data->g('token').'\' for \''.$data->g('user_id')
617 617
 						. '\'',
618 618
 						true
619 619
 					);
Please login to merge, or discard this patch.
lib/Service/MembershipService.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
 	 */
251 251
 	private function getChildrenMembers(string $id, array &$knownIds = []): array {
252 252
 		$singleIds = array_map(
253
-			function (Member $item): string {
253
+			function(Member $item): string {
254 254
 				return $item->getSingleId();
255 255
 			}, $this->memberRequest->getMembers($id)
256 256
 		);
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 	 */
275 275
 	private function getChildrenMemberships(string $id, array &$knownIds = []): array {
276 276
 		$singleIds = array_map(
277
-			function (Membership $item): string {
277
+			function(Membership $item): string {
278 278
 				return $item->getSingleId();
279 279
 			}, $this->membershipRequest->getInherited($id)
280 280
 		);
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 	 */
321 321
 	private function removeDeprecatedMemberships(array $memberships, array $known): array {
322 322
 		$circleIds = array_map(
323
-			function (Membership $membership): string {
323
+			function(Membership $membership): string {
324 324
 				return $membership->getCircleId();
325 325
 			}, $memberships
326 326
 		);
Please login to merge, or discard this patch.
lib/Command/CirclesMemberships.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -212,10 +212,10 @@  discard block
 block discarded – undo
212 212
 //			return 0;
213 213
 //		}
214 214
 
215
-		$output->writeln('Id: <info>' . $federatedUser->getUserId() . '</info>');
216
-		$output->writeln('Instance: <info>' . $federatedUser->getInstance() . '</info>');
217
-		$output->writeln('Type: <info>' . Member::$TYPE[$federatedUser->getUserType()] . '</info>');
218
-		$output->writeln('SingleId: <info>' . $federatedUser->getSingleId() . '</info>');
215
+		$output->writeln('Id: <info>'.$federatedUser->getUserId().'</info>');
216
+		$output->writeln('Instance: <info>'.$federatedUser->getInstance().'</info>');
217
+		$output->writeln('Type: <info>'.Member::$TYPE[$federatedUser->getUserType()].'</info>');
218
+		$output->writeln('SingleId: <info>'.$federatedUser->getSingleId().'</info>');
219 219
 
220 220
 		$output->writeln('');
221 221
 		$output->writeln('Memberships:');
@@ -224,14 +224,14 @@  discard block
 block discarded – undo
224 224
 		if ($count === 0) {
225 225
 			$output->writeln('(database not updated)');
226 226
 		} else {
227
-			$output->writeln('(' . $count . ' entries generated/updated in the database)');
227
+			$output->writeln('('.$count.' entries generated/updated in the database)');
228 228
 		}
229 229
 
230 230
 		foreach ($federatedUser->getMemberships() as $membership) {
231 231
 			$this->memberships[$membership->getCircleId()] = $membership;
232 232
 			$output->writeln(
233
-				'- <info>' . $membership->getCircleId() . '</info> ('
234
-				. Member::$DEF_LEVEL[$membership->getLevel()] . ')'
233
+				'- <info>'.$membership->getCircleId().'</info> ('
234
+				. Member::$DEF_LEVEL[$membership->getLevel()].')'
235 235
 			);
236 236
 		}
237 237
 
@@ -305,9 +305,9 @@  discard block
 block discarded – undo
305 305
 				if ($lineNumber === 2) {
306 306
 					return '';
307 307
 				}
308
-				$line .= '<info>' . $federatedUser->getSingleId() . '</info>';
308
+				$line .= '<info>'.$federatedUser->getSingleId().'</info>';
309 309
 				if (!$this->configService->isLocalInstance($federatedUser->getInstance())) {
310
-					$line .= '@' . $federatedUser->getInstance();
310
+					$line .= '@'.$federatedUser->getInstance();
311 311
 				}
312 312
 
313 313
 				return $line;
@@ -319,28 +319,28 @@  discard block
 block discarded – undo
319 319
 				$circle = $member->getCircle();
320 320
 
321 321
 				if ($lineNumber === 1) {
322
-					$line .= '<info>' . $circle->getSingleId() . '</info>';
322
+					$line .= '<info>'.$circle->getSingleId().'</info>';
323 323
 					if (!$this->configService->isLocalInstance($circle->getInstance())) {
324
-						$line .= '@' . $circle->getInstance();
324
+						$line .= '@'.$circle->getInstance();
325 325
 					}
326
-					$line .= ' (' . ($this->input->getOption('display-name') ?
327
-							$circle->getDisplayName() : $circle->getName()) . ')';
328
-					$line .= ' <info>MemberId</info>: ' . $member->getId();
329
-					$line .= ' <info>Level</info>: ' . Member::$DEF_LEVEL[$member->getLevel()];
326
+					$line .= ' ('.($this->input->getOption('display-name') ?
327
+							$circle->getDisplayName() : $circle->getName()).')';
328
+					$line .= ' <info>MemberId</info>: '.$member->getId();
329
+					$line .= ' <info>Level</info>: '.Member::$DEF_LEVEL[$member->getLevel()];
330 330
 
331 331
 					$knownMembership = $this->memberships[$member->getCircleId()];
332 332
 					if ($member->getLevel() !== $knownMembership->getLevel()) {
333
-						$line .= ' (' . Member::$DEF_LEVEL[$knownMembership->getLevel()] . ')';
333
+						$line .= ' ('.Member::$DEF_LEVEL[$knownMembership->getLevel()].')';
334 334
 					}
335 335
 				}
336 336
 				if ($lineNumber === 2) {
337 337
 					$owner = $circle->getOwner();
338
-					$line .= '<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance() . ' ';
338
+					$line .= '<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance().' ';
339 339
 					if ($owner->hasBasedOn()) {
340
-						$line .= '(' . Circle::$DEF_SOURCE[$owner->getBasedOn()->getSource()] . ') ';
340
+						$line .= '('.Circle::$DEF_SOURCE[$owner->getBasedOn()->getSource()].') ';
341 341
 					}
342 342
 					$type = implode(", ", Circle::getCircleFlags($circle, Circle::FLAGS_LONG));
343
-					$line .= ($type === '') ? '' : '<info>Config</info>: ' . $type;
343
+					$line .= ($type === '') ? '' : '<info>Config</info>: '.$type;
344 344
 				}
345 345
 
346 346
 				return $line;
@@ -399,6 +399,6 @@  discard block
 block discarded – undo
399 399
 			);
400 400
 		}
401 401
 
402
-		$output->writeln($count . ' memberships updated');
402
+		$output->writeln($count.' memberships updated');
403 403
 	}
404 404
 }
Please login to merge, or discard this patch.