Completed
Pull Request — master (#692)
by John
37s
created
tests/bootstrap.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,5 +5,5 @@
 block discarded – undo
5 5
 require_once __DIR__.'/../../../lib/base.php';
6 6
 require_once __DIR__.'/../vendor/autoload.php';
7 7
 
8
-\OC::$loader->addValidRoot(OC::$SERVERROOT . '/tests');
8
+\OC::$loader->addValidRoot(OC::$SERVERROOT.'/tests');
9 9
 \OC_App::loadApp('circles');
Please login to merge, or discard this patch.
tests/unit/lib/Api/CirclesTest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 			} catch (Exception $e) {
328 328
 				$this->assertSame(
329 329
 					true, false,
330
-					'should have returned a MemberIsNotModeratorException - ' . $e->getMessage()
330
+					'should have returned a MemberIsNotModeratorException - '.$e->getMessage()
331 331
 				);
332 332
 			}
333 333
 
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 			} catch (Exception $e) {
342 342
 				$this->assertSame(
343 343
 					true, false,
344
-					'should have returned a MemberIsNotModeratorException - ' . $e->getMessage()
344
+					'should have returned a MemberIsNotModeratorException - '.$e->getMessage()
345 345
 				);
346 346
 			}
347 347
 		}
Please login to merge, or discard this patch.
lib/Command/CirclesRemote.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -173,19 +173,19 @@  discard block
 block discarded – undo
173 173
 
174 174
 		$webfinger = $this->getWebfinger($host, Application::APP_SUBJECT);
175 175
 		if ($this->input->getOption('all')) {
176
-			$this->output->writeln('- Webfinger on <info>' . $host . '</info>');
176
+			$this->output->writeln('- Webfinger on <info>'.$host.'</info>');
177 177
 			$this->output->writeln(json_encode($webfinger, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
178 178
 			$this->output->writeln('');
179 179
 		}
180 180
 
181 181
 		if ($this->input->getOption('all')) {
182 182
 			$circleLink = $this->extractLink(Application::APP_REL, $webfinger);
183
-			$this->output->writeln('- Information about Circles app on <info>' . $host . '</info>');
183
+			$this->output->writeln('- Information about Circles app on <info>'.$host.'</info>');
184 184
 			$this->output->writeln(json_encode($circleLink, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
185 185
 			$this->output->writeln('');
186 186
 		}
187 187
 
188
-		$this->output->writeln('- Available services on <info>' . $host . '</info>');
188
+		$this->output->writeln('- Available services on <info>'.$host.'</info>');
189 189
 		foreach ($webfinger->getLinks() as $link) {
190 190
 			$app = $link->getProperty('name');
191 191
 			$ver = $link->getProperty('version');
@@ -193,14 +193,14 @@  discard block
 block discarded – undo
193 193
 				$app .= ' ';
194 194
 			}
195 195
 			if ($ver !== '') {
196
-				$ver = 'v' . $ver;
196
+				$ver = 'v'.$ver;
197 197
 			}
198 198
 
199
-			$this->output->writeln(' * ' . $link->getRel() . ' ' . $app . $ver);
199
+			$this->output->writeln(' * '.$link->getRel().' '.$app.$ver);
200 200
 		}
201 201
 		$this->output->writeln('');
202 202
 
203
-		$this->output->writeln('- Resources related to Circles on <info>' . $host . '</info>');
203
+		$this->output->writeln('- Resources related to Circles on <info>'.$host.'</info>');
204 204
 		$resource = $this->getResourceData($host, Application::APP_SUBJECT, Application::APP_REL);
205 205
 		$this->output->writeln(json_encode($resource, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
206 206
 		$this->output->writeln('');
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 
209 209
 		$tempUid = $resource->g('uid');
210 210
 		$this->output->writeln(
211
-			'- Confirming UID=' . $tempUid . ' from parsed Signatory at <info>' . $host . '</info>'
211
+			'- Confirming UID='.$tempUid.' from parsed Signatory at <info>'.$host.'</info>'
212 212
 		);
213 213
 
214 214
 		try {
@@ -217,15 +217,15 @@  discard block
 block discarded – undo
217 217
 			$this->output->writeln(' * No SignatureException: <info>Identity authed</info>');
218 218
 		} catch (SignatureException $e) {
219 219
 			$this->output->writeln(
220
-				'<error>' . $host . ' cannot auth its identity: ' . $e->getMessage() . '</error>'
220
+				'<error>'.$host.' cannot auth its identity: '.$e->getMessage().'</error>'
221 221
 			);
222 222
 
223 223
 			return;
224 224
 		}
225 225
 
226
-		$this->output->writeln(' * Found <info>' . $remoteSignatory->getUid() . '</info>');
226
+		$this->output->writeln(' * Found <info>'.$remoteSignatory->getUid().'</info>');
227 227
 		if ($remoteSignatory->getUid(true) !== $tempUid) {
228
-			$this->output->writeln('<error>looks like ' . $host . ' is faking its identity');
228
+			$this->output->writeln('<error>looks like '.$host.' is faking its identity');
229 229
 
230 230
 			return;
231 231
 		}
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 		$this->output->writeln('');
234 234
 
235 235
 		$testUrl = $resource->g('test');
236
-		$this->output->writeln('- Testing signed payload on <info>' . $testUrl . '</info>');
236
+		$this->output->writeln('- Testing signed payload on <info>'.$testUrl.'</info>');
237 237
 
238 238
 		try {
239 239
 			$localSignatory = $this->remoteStreamService->getAppSignatory();
@@ -255,18 +255,18 @@  discard block
 block discarded – undo
255 255
 		$this->output->writeln('');
256 256
 
257 257
 		$this->output->writeln(' * Clear Signature: ');
258
-		$this->output->writeln('<comment>' . $signedRequest->getClearSignature() . '</comment>');
258
+		$this->output->writeln('<comment>'.$signedRequest->getClearSignature().'</comment>');
259 259
 		$this->output->writeln('');
260 260
 
261 261
 		$this->output->writeln(' * Signed Signature (base64 encoded): ');
262 262
 		$this->output->writeln(
263
-			'<comment>' . base64_encode($signedRequest->getSignedSignature()) . '</comment>'
263
+			'<comment>'.base64_encode($signedRequest->getSignedSignature()).'</comment>'
264 264
 		);
265 265
 		$this->output->writeln('');
266 266
 
267 267
 		$result = $signedRequest->getOutgoingRequest()->getResult();
268 268
 		$code = $result->getStatusCode();
269
-		$this->output->writeln(' * Result: ' . (($code === 200) ? '<info>' . $code . '</info>' : $code));
269
+		$this->output->writeln(' * Result: '.(($code === 200) ? '<info>'.$code.'</info>' : $code));
270 270
 		$this->output->writeln(
271 271
 			json_encode(json_decode($result->getContent(), true), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)
272 272
 		);
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 				$stored = new RemoteInstance();
289 289
 				$this->remoteStreamService->confirmValidRemote($remoteSignatory, $stored);
290 290
 				$this->output->writeln(
291
-					'<info>The remote instance ' . $host
291
+					'<info>The remote instance '.$host
292 292
 					. ' is already known with this current identity</info>'
293 293
 				);
294 294
 
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 
299 299
 				if ($remoteSignatory->getType() !== $stored->getType()) {
300 300
 					$this->output->writeln(
301
-						'- updating type from ' . $stored->getType() . ' to '
301
+						'- updating type from '.$stored->getType().' to '
302 302
 						. $remoteSignatory->getType()
303 303
 					);
304 304
 					$this->remoteStreamService->update(
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 
309 309
 				if ($remoteSignatory->getInstance() !== $stored->getInstance()) {
310 310
 					$this->output->writeln(
311
-						'- updating host from ' . $stored->getInstance() . ' to '
311
+						'- updating host from '.$stored->getInstance().' to '
312 312
 						. $remoteSignatory->getInstance()
313 313
 					);
314 314
 					$this->remoteStreamService->update(
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 				}
318 318
 				if ($remoteSignatory->getId() !== $stored->getId()) {
319 319
 					$this->output->writeln(
320
-						'- updating href/Id from ' . $stored->getId() . ' to '
320
+						'- updating href/Id from '.$stored->getId().' to '
321 321
 						. $remoteSignatory->getId()
322 322
 					);
323 323
 					$this->remoteStreamService->update($remoteSignatory, RemoteStreamService::UPDATE_HREF);
@@ -341,10 +341,10 @@  discard block
 block discarded – undo
341 341
 		$helper = $this->getHelper('question');
342 342
 
343 343
 		$this->output->writeln(
344
-			'The remote instance <info>' . $remoteSignatory->getInstance() . '</info> looks good.'
344
+			'The remote instance <info>'.$remoteSignatory->getInstance().'</info> looks good.'
345 345
 		);
346 346
 		$question = new ConfirmationQuestion(
347
-			'Would you like to identify this remote instance as \'<comment>' . $remoteSignatory->getType()
347
+			'Would you like to identify this remote instance as \'<comment>'.$remoteSignatory->getType()
348 348
 			. '</comment>\' using interface \'<comment>'
349 349
 			. InterfaceService::$LIST_IFACE[$remoteSignatory->getInterface()]
350 350
 			. '</comment>\' ? (y/N) ',
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
 		$helper = $this->getHelper('question');
373 373
 
374 374
 		$this->output->writeln(
375
-			'The remote instance <info>' . $remoteSignatory->getInstance()
375
+			'The remote instance <info>'.$remoteSignatory->getInstance()
376 376
 			. '</info> is known but <error>its identity has changed.</error>'
377 377
 		);
378 378
 		$this->output->writeln(
@@ -430,7 +430,7 @@  discard block
 block discarded – undo
430 430
 	private function verifyGSInstances(): void {
431 431
 		$instances = $this->globalScaleService->getGlobalScaleInstances();
432 432
 		$known = array_map(
433
-			function (RemoteInstance $instance): string {
433
+			function(RemoteInstance $instance): string {
434 434
 				return $instance->getInstance();
435 435
 			}, $this->remoteRequest->getFromType(RemoteInstance::TYPE_GLOBALSCALE)
436 436
 		);
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 			return;
451 451
 		}
452 452
 
453
-		$this->output->write('Adding <comment>' . $instance . '</comment>: ');
453
+		$this->output->write('Adding <comment>'.$instance.'</comment>: ');
454 454
 		try {
455 455
 			$this->remoteStreamService->addRemoteInstance(
456 456
 				$instance,
@@ -460,8 +460,8 @@  discard block
 block discarded – undo
460 460
 			);
461 461
 			$this->output->writeln('<info>ok</info>');
462 462
 		} catch (Exception $e) {
463
-			$msg = ($e->getMessage() === '') ? '' : ' (' . $e->getMessage() . ')';
464
-			$this->output->writeln('<error>' . get_class($e) . $msg . '</error>');
463
+			$msg = ($e->getMessage() === '') ? '' : ' ('.$e->getMessage().')';
464
+			$this->output->writeln('<error>'.get_class($e).$msg.'</error>');
465 465
 		}
466 466
 	}
467 467
 
@@ -479,12 +479,12 @@  discard block
 block discarded – undo
479 479
 			try {
480 480
 				$current = $this->remoteStreamService->retrieveRemoteInstance($instance->getInstance());
481 481
 				if ($current->getUid(true) === $instance->getUid(true)) {
482
-					$currentUid = '<info>' . $current->getUid(true) . '</info>';
482
+					$currentUid = '<info>'.$current->getUid(true).'</info>';
483 483
 				} else {
484
-					$currentUid = '<error>' . $current->getUid(true) . '</error>';
484
+					$currentUid = '<error>'.$current->getUid(true).'</error>';
485 485
 				}
486 486
 			} catch (Exception $e) {
487
-				$currentUid = '<error>' . $e->getMessage() . '</error>';
487
+				$currentUid = '<error>'.$e->getMessage().'</error>';
488 488
 			}
489 489
 
490 490
 			$table->appendRow(
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 			}
512 512
 		}
513 513
 
514
-		throw new Exception('Unknown type: ' . implode(', ', RemoteInstance::$LIST_TYPE));
514
+		throw new Exception('Unknown type: '.implode(', ', RemoteInstance::$LIST_TYPE));
515 515
 	}
516 516
 
517 517
 	/**
@@ -524,6 +524,6 @@  discard block
 block discarded – undo
524 524
 			}
525 525
 		}
526 526
 
527
-		throw new Exception('Unknown interface: ' . implode(', ', InterfaceService::$LIST_IFACE));
527
+		throw new Exception('Unknown interface: '.implode(', ', InterfaceService::$LIST_IFACE));
528 528
 	}
529 529
 }
Please login to merge, or discard this patch.
lib/Command/CirclesTest.php 1 patch
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 			} catch (Exception $e) {
156 156
 				if ($this->pOn) {
157 157
 					$message = ($e->getMessage() !== '') ? $e->getMessage() : get_class($e);
158
-					$this->output->writeln('<error>' . $message . '</error>');
158
+					$this->output->writeln('<error>'.$message.'</error>');
159 159
 				} else {
160 160
 					throw $e;
161 161
 				}
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 	 */
240 240
 	private function loadConfiguration() {
241 241
 		$this->p('Loading configuration');
242
-		$configuration = file_get_contents(__DIR__ . '/../../testConfiguration.json');
242
+		$configuration = file_get_contents(__DIR__.'/../../testConfiguration.json');
243 243
 		$this->config = json_decode($configuration, true);
244 244
 		$this->r(true, 'testConfiguration.json');
245 245
 
@@ -272,22 +272,22 @@  discard block
 block discarded – undo
272 272
 		$this->r();
273 273
 
274 274
 		foreach ($this->getInstances() as $instance) {
275
-			$this->p('Creating users on ' . $instance);
275
+			$this->p('Creating users on '.$instance);
276 276
 			foreach ($this->getConfigArray($instance, 'users') as $userId) {
277 277
 				$this->pm($userId);
278 278
 				$this->occ(
279
-					$instance, 'user:add --password-from-env ' . $userId, false, false,
279
+					$instance, 'user:add --password-from-env '.$userId, false, false,
280 280
 					['OC_PASS' => 'testtest']
281 281
 				);
282 282
 			}
283 283
 			$this->r();
284 284
 
285 285
 			foreach ($this->getConfigArray($instance, 'groups') as $groupId => $users) {
286
-				$this->p('Creating group <info>' . $groupId . '</info> on <info>' . $instance . '</info>');
287
-				$this->occ($instance, 'group:add ' . $groupId, false, false);
286
+				$this->p('Creating group <info>'.$groupId.'</info> on <info>'.$instance.'</info>');
287
+				$this->occ($instance, 'group:add '.$groupId, false, false);
288 288
 				foreach ($users as $userId) {
289 289
 					$this->pm($userId);
290
-					$this->occ($instance, 'group:adduser ' . $groupId . ' ' . $userId, true, false);
290
+					$this->occ($instance, 'group:adduser '.$groupId.' '.$userId, true, false);
291 291
 				}
292 292
 				$this->r();
293 293
 			}
@@ -321,7 +321,7 @@  discard block
 block discarded – undo
321 321
 		foreach ($this->getInstances(true) as $instance) {
322 322
 			$this->pm($instance);
323 323
 			foreach ($this->getConfigArray($instance, 'config') as $k => $v) {
324
-				$this->occ($instance, 'config:app:set --value ' . $v . ' circles ' . $k, true, false);
324
+				$this->occ($instance, 'config:app:set --value '.$v.' circles '.$k, true, false);
325 325
 			}
326 326
 		}
327 327
 		$this->r();
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 	 */
335 335
 	private function confirmVersion() {
336 336
 		$version = $this->configService->getAppValue('installed_version');
337
-		$this->p('Confirming version <info>' . $version . '</info>');
337
+		$this->p('Confirming version <info>'.$version.'</info>');
338 338
 		foreach ($this->getInstances(false) as $instance) {
339 339
 			$this->pm($instance);
340 340
 			$capabilities = $this->occ($instance, 'circles:check --capabilities');
@@ -385,12 +385,12 @@  discard block
 block discarded – undo
385 385
 	 */
386 386
 	private function statusFreshInstances() {
387 387
 		foreach ($this->getInstances() as $instanceId) {
388
-			$this->p('Circles on ' . $instanceId);
388
+			$this->p('Circles on '.$instanceId);
389 389
 			$result = $this->occ($instanceId, 'circles:manage:list --all');
390 390
 			$expectedSize = sizeof($this->getConfigArray($instanceId, 'groups'))
391 391
 							+ sizeof($this->getConfigArray($instanceId, 'users'))
392 392
 							+ 1;
393
-			$this->r((sizeof($result) === $expectedSize), sizeof($result) . ' circles');
393
+			$this->r((sizeof($result) === $expectedSize), sizeof($result).' circles');
394 394
 
395 395
 			$membersList = $groupsList = [];
396 396
 			foreach ($result as $item) {
@@ -409,12 +409,12 @@  discard block
 block discarded – undo
409 409
 			$instance = $this->getConfig($instanceId, 'config.frontal_cloud_id');
410 410
 
411 411
 			foreach ($this->getConfigArray($instanceId, 'users') as $userId) {
412
-				$this->p('Checking Single Circle for <comment>' . $userId . '@' . $instance . '</comment>');
412
+				$this->p('Checking Single Circle for <comment>'.$userId.'@'.$instance.'</comment>');
413 413
 				$circle = $this->getSingleCircleForMember($membersList, $userId, $instance);
414 414
 
415 415
 				$compareToOwnerBasedOn = new Circle();
416 416
 				$compareToOwnerBasedOn->setConfig(Circle::CFG_SINGLE)
417
-									  ->setName('user:' . $userId . ':{CIRCLEID}')
417
+									  ->setName('user:'.$userId.':{CIRCLEID}')
418 418
 									  ->setDisplayName($userId);
419 419
 
420 420
 				$compareToOwner = new Member();
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
 				$compareTo = new Circle();
433 433
 				$compareTo->setOwner($compareToOwner)
434 434
 						  ->setConfig(Circle::CFG_SINGLE)
435
-						  ->setName('user:' . $userId . ':{CIRCLEID}')
435
+						  ->setName('user:'.$userId.':{CIRCLEID}')
436 436
 						  ->setDisplayName($userId);
437 437
 
438 438
 				$this->confirmCircleData($circle, $compareTo);
@@ -469,8 +469,8 @@  discard block
 block discarded – undo
469 469
 			$this->r(true, $circle->getSingleId());
470 470
 
471 471
 			foreach ($this->getConfigArray($instanceId, 'groups') as $groupId => $members) {
472
-				$this->p('Checking Circle for <comment>' . $groupId . '@' . $instance . '</comment>');
473
-				$circle = $this->getCircleFromList($groupsList, 'group:' . $groupId);
472
+				$this->p('Checking Circle for <comment>'.$groupId.'@'.$instance.'</comment>');
473
+				$circle = $this->getCircleFromList($groupsList, 'group:'.$groupId);
474 474
 
475 475
 				$appCircle = $this->getSingleCircleForMember($membersList, 'circles', $instance);
476 476
 				$appOwner = $appCircle->getOwner();
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
 				$compareTo = new Circle();
495 495
 				$compareTo->setOwner($compareToOwner)
496 496
 						  ->setConfig(Circle::CFG_SYSTEM | Circle::CFG_NO_OWNER | Circle::CFG_HIDDEN)
497
-						  ->setName('group:' . $groupId)
497
+						  ->setName('group:'.$groupId)
498 498
 						  ->setDisplayName($groupId);
499 499
 
500 500
 				$this->confirmCircleData($circle, $compareTo);
@@ -511,12 +511,12 @@  discard block
 block discarded – undo
511 511
 	 */
512 512
 	private function createRemoteLink() {
513 513
 		foreach ($this->getInstances() as $instanceId) {
514
-			$this->p('Init remote link from ' . $instanceId);
514
+			$this->p('Init remote link from '.$instanceId);
515 515
 			$links = $this->getConfigArray($instanceId, 'remote');
516 516
 			foreach ($links as $link => $type) {
517 517
 				$remote = $this->getConfig($link, 'config.frontal_cloud_id');
518
-				$this->pm($remote . '(' . $type . ')');
519
-				$this->occ($instanceId, 'circles:remote ' . $remote . ' --type ' . $type . ' --yes');
518
+				$this->pm($remote.'('.$type.')');
519
+				$this->occ($instanceId, 'circles:remote '.$remote.' --type '.$type.' --yes');
520 520
 			}
521 521
 			$this->r();
522 522
 		}
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 	private function buildingLocalDatabase() {
531 531
 		$this->circles = $this->federatedUsers = [];
532 532
 		foreach ($this->getInstances() as $instanceId) {
533
-			$this->p('Retrieving Circles from ' . $instanceId);
533
+			$this->p('Retrieving Circles from '.$instanceId);
534 534
 			$circles = $this->occ($instanceId, 'circles:manage:list --all');
535 535
 			foreach ($circles as $item) {
536 536
 				/** @var Circle $circle */
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
 		$name = self::$TEST_CIRCLES[0];
566 566
 		$owner = $this->getInstanceUsers($localInstanceId)[1];
567 567
 		$dataCreatedCircle001 =
568
-			$this->occ($localInstanceId, 'circles:manage:create --type user ' . $owner . ' ' . $name);
568
+			$this->occ($localInstanceId, 'circles:manage:create --type user '.$owner.' '.$name);
569 569
 		/** @var Circle $createdCircle */
570 570
 		$createdCircle = $this->deserialize($dataCreatedCircle001, Circle::class);
571 571
 		$this->circles[$localInstanceId][$createdCircle->getName()] = $createdCircle;
@@ -597,7 +597,7 @@  discard block
 block discarded – undo
597 597
 
598 598
 
599 599
 		$this->p('Comparing local stored data');
600
-		$dataCircle = $this->occ($localInstanceId, 'circle:manage:details ' . $createdCircle->getSingleId());
600
+		$dataCircle = $this->occ($localInstanceId, 'circle:manage:details '.$createdCircle->getSingleId());
601 601
 
602 602
 		/** @var Circle $tmpCircle */
603 603
 		$tmpCircle = $this->deserialize($dataCircle, Circle::class);
@@ -606,9 +606,9 @@  discard block
 block discarded – undo
606 606
 
607 607
 		$links = $this->getConfigArray('global-scale-1', 'remote');
608 608
 		foreach ($this->getInstances(false) as $instanceId) {
609
-			$this->p('Comparing data stored on ' . $instanceId);
609
+			$this->p('Comparing data stored on '.$instanceId);
610 610
 			$dataCircle =
611
-				$this->occ($instanceId, 'circle:manage:details ' . $createdCircle->getSingleId(), false);
611
+				$this->occ($instanceId, 'circle:manage:details '.$createdCircle->getSingleId(), false);
612 612
 
613 613
 			if ($instanceId === $localInstanceId || $links[$instanceId] === 'GlobalScale') {
614 614
 				/** @var Circle $tmpCircle */
@@ -661,11 +661,11 @@  discard block
 block discarded – undo
661 661
 		$name = self::$TEST_CIRCLES[0];
662 662
 		$circle = $this->getCircleByName($localInstanceId, $name);
663 663
 		$userId = $this->getInstanceUsers($localInstanceId)[6];
664
-		$userCircle = $this->getCircleByName($localInstanceId, 'user:' . $userId);
664
+		$userCircle = $this->getCircleByName($localInstanceId, 'user:'.$userId);
665 665
 		$user = $userCircle->getOwner();
666 666
 		$dataAddedMember =
667 667
 			$this->occ(
668
-				$localInstanceId, 'circles:members:add ' . $circle->getSingleId() . ' ' . $user->getSingleId()
668
+				$localInstanceId, 'circles:members:add '.$circle->getSingleId().' '.$user->getSingleId()
669 669
 			);
670 670
 		/** @var Member $addedMember */
671 671
 		$addedMember = $this->deserialize($dataAddedMember, Member::class);
@@ -685,11 +685,11 @@  discard block
 block discarded – undo
685 685
 
686 686
 		$circle = $this->getCircleByName($localInstanceId, $circleName);
687 687
 		$userId = $this->getInstanceUsers($localInstanceId)[6];
688
-		$userCircle = $this->getCircleByName($localInstanceId, 'user:' . $userId);
688
+		$userCircle = $this->getCircleByName($localInstanceId, 'user:'.$userId);
689 689
 		$user = $userCircle->getOwner();
690 690
 		$dataAddedMember =
691 691
 			$this->occ(
692
-				$localInstanceId, 'circles:members:add ' . $circle->getSingleId() . ' ' . $user->getSingleId()
692
+				$localInstanceId, 'circles:members:add '.$circle->getSingleId().' '.$user->getSingleId()
693 693
 			);
694 694
 		/** @var Member $addedMember */
695 695
 		$addedMember = $this->deserialize($dataAddedMember, Member::class);
@@ -783,13 +783,13 @@  discard block
 block discarded – undo
783 783
 			];
784 784
 		}
785 785
 
786
-		$this->compare($compareTo->getSingleId(), $circle->getSingleId(), $prefix . '.id', $params);
787
-		$this->compare($compareTo->getName(), $circle->getName(), $prefix . '.name', $params);
786
+		$this->compare($compareTo->getSingleId(), $circle->getSingleId(), $prefix.'.id', $params);
787
+		$this->compare($compareTo->getName(), $circle->getName(), $prefix.'.name', $params);
788 788
 		$this->compare(
789
-			$compareTo->getDisplayName(), $circle->getDisplayName(), $prefix . '.displayName', $params
789
+			$compareTo->getDisplayName(), $circle->getDisplayName(), $prefix.'.displayName', $params
790 790
 		);
791
-		$this->compareInt($compareTo->getConfig(), $circle->getConfig(), $prefix . '.config', true);
792
-		$this->compareInt($compareTo->getSource(), $circle->getSource(), $prefix . '.source');
791
+		$this->compareInt($compareTo->getConfig(), $circle->getConfig(), $prefix.'.config', true);
792
+		$this->compareInt($compareTo->getSource(), $circle->getSource(), $prefix.'.source');
793 793
 
794 794
 		if ($compareTo->hasOwner()) {
795 795
 			$compareToOwner = $compareTo->getOwner();
@@ -799,7 +799,7 @@  discard block
 block discarded – undo
799 799
 					throw new Exception('empty owner');
800 800
 				}
801 801
 				if ($owner->getCircleId() !== $circle->getSingleId()) {
802
-					throw new Exception($prefix . '.owner.circleId is different than ' . $prefix . '.id');
802
+					throw new Exception($prefix.'.owner.circleId is different than '.$prefix.'.id');
803 803
 				}
804 804
 				$this->confirmMemberData($owner, $compareToOwner, 'owner', false, $params);
805 805
 			}
@@ -812,7 +812,7 @@  discard block
 block discarded – undo
812 812
 				}
813 813
 				$initiator = $circle->getInitiator();
814 814
 				if ($initiator->getCircleId() !== $circle->getSingleId()) {
815
-					throw new Exception($prefix . '.initiator.circleId is different than ' . $prefix . '.id');
815
+					throw new Exception($prefix.'.initiator.circleId is different than '.$prefix.'.id');
816 816
 				}
817 817
 				$this->confirmMemberData($initiator, $compareToInitiator, 'owner', false, $params);
818 818
 			}
@@ -839,27 +839,27 @@  discard block
 block discarded – undo
839 839
 		bool $versa = false,
840 840
 		array $params = []
841 841
 	) {
842
-		$this->compare($compareTo->getId(), $member->getId(), $prefix . '.id', $params);
843
-		$this->compare($compareTo->getCircleId(), $member->getCircleId(), $prefix . '.circleId', $params);
844
-		$this->compare($compareTo->getSingleId(), $member->getSingleId(), $prefix . '.singleId', $params);
845
-		$this->compare($compareTo->getUserId(), $member->getUserId(), $prefix . '.userId', $params);
842
+		$this->compare($compareTo->getId(), $member->getId(), $prefix.'.id', $params);
843
+		$this->compare($compareTo->getCircleId(), $member->getCircleId(), $prefix.'.circleId', $params);
844
+		$this->compare($compareTo->getSingleId(), $member->getSingleId(), $prefix.'.singleId', $params);
845
+		$this->compare($compareTo->getUserId(), $member->getUserId(), $prefix.'.userId', $params);
846 846
 		$this->compare(
847
-			$compareTo->getDisplayName(), $member->getDisplayName(), $prefix . '.displayName', $params
847
+			$compareTo->getDisplayName(), $member->getDisplayName(), $prefix.'.displayName', $params
848 848
 		);
849
-		$this->compareInt($compareTo->getUserType(), $member->getUserType(), $prefix . '.userType');
850
-		$this->compare($compareTo->getInstance(), $member->getInstance(), $prefix . '.instance', $params);
851
-		$this->compareInt($compareTo->getLevel(), $member->getLevel(), $prefix . '.level', true);
852
-		$this->compare($compareTo->getStatus(), $member->getStatus(), $prefix . '.status', $params);
849
+		$this->compareInt($compareTo->getUserType(), $member->getUserType(), $prefix.'.userType');
850
+		$this->compare($compareTo->getInstance(), $member->getInstance(), $prefix.'.instance', $params);
851
+		$this->compareInt($compareTo->getLevel(), $member->getLevel(), $prefix.'.level', true);
852
+		$this->compare($compareTo->getStatus(), $member->getStatus(), $prefix.'.status', $params);
853 853
 
854 854
 		if ($compareTo->hasBasedOn()) {
855 855
 			if (!$member->hasBasedOn()) {
856
-				throw new Exception('empty ' . $prefix . '.basedOn');
856
+				throw new Exception('empty '.$prefix.'.basedOn');
857 857
 			}
858 858
 			$basedOn = $member->getBasedOn();
859 859
 			$this->confirmCircleData(
860 860
 				$basedOn,
861 861
 				$compareTo->getBasedOn(),
862
-				$prefix . '.basedOn',
862
+				$prefix.'.basedOn',
863 863
 				false,
864 864
 				$params
865 865
 			);
@@ -878,7 +878,7 @@  discard block
 block discarded – undo
878 878
 	private function compare(string $expected, string $compare, string $def, array $params) {
879 879
 		if ($expected !== ''
880 880
 			&& $this->feedStringWithParams($expected, $params) !== $compare) {
881
-			throw new Exception($def . ': ' . $compare . ' (' . $expected . ')');
881
+			throw new Exception($def.': '.$compare.' ('.$expected.')');
882 882
 		}
883 883
 	}
884 884
 
@@ -894,7 +894,7 @@  discard block
 block discarded – undo
894 894
 	private function compareInt(int $expected, int $compare, string $def, bool $force = false) {
895 895
 		if (($expected > 0 || ($force && $expected >= 0))
896 896
 			&& $expected !== $compare) {
897
-			throw new Exception('wrong ' . $def . ': ' . $compare . ' (' . $expected . ')');
897
+			throw new Exception('wrong '.$def.': '.$compare.' ('.$expected.')');
898 898
 		}
899 899
 	}
900 900
 
@@ -930,7 +930,7 @@  discard block
 block discarded – undo
930 930
 			}
931 931
 		}
932 932
 
933
-		throw new CircleNotFoundException('cannot find ' . $userId . ' in the list of Single Circle');
933
+		throw new CircleNotFoundException('cannot find '.$userId.' in the list of Single Circle');
934 934
 	}
935 935
 
936 936
 
@@ -948,7 +948,7 @@  discard block
 block discarded – undo
948 948
 		}
949 949
 
950 950
 		throw new CircleNotFoundException(
951
-			'cannot extract \'' . $name . '\' from the list of generated Circles'
951
+			'cannot extract \''.$name.'\' from the list of generated Circles'
952 952
 		);
953 953
 	}
954 954
 
@@ -968,7 +968,7 @@  discard block
 block discarded – undo
968 968
 		}
969 969
 
970 970
 		throw new CircleNotFoundException(
971
-			'cannot extract  \'' . $name . '\' from the list of provided Circles'
971
+			'cannot extract  \''.$name.'\' from the list of provided Circles'
972 972
 		);
973 973
 	}
974 974
 
@@ -1013,7 +1013,7 @@  discard block
 block discarded – undo
1013 1013
 			}
1014 1014
 		}
1015 1015
 
1016
-		throw new ItemNotFoundException($instance . ' not found');
1016
+		throw new ItemNotFoundException($instance.' not found');
1017 1017
 	}
1018 1018
 
1019 1019
 
@@ -1048,7 +1048,7 @@  discard block
 block discarded – undo
1048 1048
 	): ?array {
1049 1049
 		$configInstance = $this->getConfigInstance($instance);
1050 1050
 		$path = $this->get('path', $configInstance);
1051
-		$occ = rtrim($path, '/') . '/occ';
1051
+		$occ = rtrim($path, '/').'/occ';
1052 1052
 
1053 1053
 		$command = array_merge([$occ], explode(' ', $cmd));
1054 1054
 		if ($jsonAsOutput) {
@@ -1058,7 +1058,7 @@  discard block
 block discarded – undo
1058 1058
 		$process->run(null, $env);
1059 1059
 
1060 1060
 		if ($exceptionOnFail && !$process->isSuccessful()) {
1061
-			throw new Exception(implode(' ', $command) . ' failed');
1061
+			throw new Exception(implode(' ', $command).' failed');
1062 1062
 		}
1063 1063
 
1064 1064
 		$output = json_decode($process->getOutput(), true);
@@ -1081,7 +1081,7 @@  discard block
 block discarded – undo
1081 1081
 	 */
1082 1082
 	private function t(string $title): void {
1083 1083
 		$this->output->writeln('');
1084
-		$this->output->writeln('<comment>### ' . $title . '</comment>');
1084
+		$this->output->writeln('<comment>### '.$title.'</comment>');
1085 1085
 		$this->output->writeln('');
1086 1086
 	}
1087 1087
 
@@ -1090,14 +1090,14 @@  discard block
 block discarded – undo
1090 1090
 	 */
1091 1091
 	private function p(string $processing): void {
1092 1092
 		$this->pOn = true;
1093
-		$this->output->write('- ' . $processing . ': ');
1093
+		$this->output->write('- '.$processing.': ');
1094 1094
 	}
1095 1095
 
1096 1096
 	/**
1097 1097
 	 * @param string $more
1098 1098
 	 */
1099 1099
 	private function pm(string $more): void {
1100
-		$this->output->write($more . ' ');
1100
+		$this->output->write($more.' ');
1101 1101
 	}
1102 1102
 
1103 1103
 	/**
@@ -1107,9 +1107,9 @@  discard block
 block discarded – undo
1107 1107
 	private function r(bool $result = true, string $info = ''): void {
1108 1108
 		$this->pOn = false;
1109 1109
 		if ($result) {
1110
-			$this->output->writeln('<info>' . (($info !== '') ? $info : 'done') . '</info>');
1110
+			$this->output->writeln('<info>'.(($info !== '') ? $info : 'done').'</info>');
1111 1111
 		} else {
1112
-			$this->output->writeln('<error>' . (($info !== '') ? $info : 'done') . '</error>');
1112
+			$this->output->writeln('<error>'.(($info !== '') ? $info : 'done').'</error>');
1113 1113
 		}
1114 1114
 	}
1115 1115
 
@@ -1131,16 +1131,16 @@  discard block
 block discarded – undo
1131 1131
 		$dataAddedMember =
1132 1132
 			$this->occ(
1133 1133
 				$instanceId,
1134
-				'circles:members:add ' . $circle->getSingleId() . ' ' . $userId . ' --type ' . $type
1134
+				'circles:members:add '.$circle->getSingleId().' '.$userId.' --type '.$type
1135 1135
 			);
1136 1136
 		/** @var Member $addedMember */
1137 1137
 		$addedMember = $this->deserialize($dataAddedMember, Member::class);
1138 1138
 
1139 1139
 
1140
-		echo 'ADDEDMEMBER: ' . json_encode($addedMember, JSON_PRETTY_PRINT) . "\n";
1140
+		echo 'ADDEDMEMBER: '.json_encode($addedMember, JSON_PRETTY_PRINT)."\n";
1141 1141
 
1142 1142
 		$federatedUser = $this->federatedUsers[$instanceId][$userId];
1143
-		echo 'FEDERATEDUER: ' . json_encode($federatedUser, JSON_PRETTY_PRINT) . "\n";
1143
+		echo 'FEDERATEDUER: '.json_encode($federatedUser, JSON_PRETTY_PRINT)."\n";
1144 1144
 
1145 1145
 		return $addedMember;
1146 1146
 	}
Please login to merge, or discard this patch.
lib/Command/CirclesConfig.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 		} catch (FederatedItemException $e) {
156 156
 			if ($input->getOption('status-code')) {
157 157
 				throw new FederatedItemException(
158
-					' [' . get_class($e) . ', ' . $e->getStatus() . ']' . "\n" . $e->getMessage()
158
+					' ['.get_class($e).', '.$e->getStatus().']'."\n".$e->getMessage()
159 159
 				);
160 160
 			}
161 161
 
@@ -189,8 +189,8 @@  discard block
 block discarded – undo
189 189
 			$value = array_search(strtoupper($item), $valid);
190 190
 			if (!$value) {
191 191
 				throw new InvalidArgumentException(
192
-					'Invalid config \'' . $item . '\'. Available values: '
193
-					. implode(', ', array_values($valid)) . '. '
192
+					'Invalid config \''.$item.'\'. Available values: '
193
+					. implode(', ', array_values($valid)).'. '
194 194
 					. 'To disable a config, start the value with an underscore'
195 195
 				);
196 196
 			}
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 
220 220
 		array_walk(
221 221
 			$listing,
222
-			function (string &$v): void {
222
+			function(string &$v): void {
223 223
 				[, $long] = explode('|', $v);
224 224
 				$v = strtoupper(str_replace(' ', '', $long));
225 225
 			}
Please login to merge, or discard this patch.
lib/Command/SharesFiles.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 				$recipient = $share->getInitiator();
220 220
 				$sharedTo = $recipient->getDisplayName();
221 221
 				if (!$this->configService->isLocalInstance($recipient->getInstance())) {
222
-					$sharedTo .= '@' . $recipient->getInstance();
222
+					$sharedTo .= '@'.$recipient->getInstance();
223 223
 				}
224 224
 			}
225 225
 			$circle = $share->getCircle();
@@ -229,15 +229,15 @@  discard block
 block discarded – undo
229 229
 				$share->getShareOwner(),
230 230
 				$share->getFileTarget(),
231 231
 				$share->getSharedBy(),
232
-				$circle->getDisplayName() . ' (' . $share->getSharedWith()
233
-				. ', ' . Circle::$DEF_SOURCE[$circle->getSource()] . ')'
232
+				$circle->getDisplayName().' ('.$share->getSharedWith()
233
+				. ', '.Circle::$DEF_SOURCE[$circle->getSource()].')'
234 234
 			];
235 235
 
236 236
 			if (!$filterRecipient) {
237 237
 				$row = array_merge(
238 238
 					$row, [
239
-						$sharedTo . ' (' . $recipient->getSingleId() . ', '
240
-						. Circle::$DEF_SOURCE[$recipient->getBasedOn()->getSource()] . ')',
239
+						$sharedTo.' ('.$recipient->getSingleId().', '
240
+						. Circle::$DEF_SOURCE[$recipient->getBasedOn()->getSource()].')',
241 241
 						(($share->getChildId() > 0) ? $share->getChildFileTarget(
242 242
 						) : $share->getFileTarget()),
243 243
 					]
Please login to merge, or discard this patch.
lib/Activity/ProviderParser.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 				continue;
138 138
 			}
139 139
 
140
-			$replace['{' . $k . '}'] = $data[$k]['_parsed'];
140
+			$replace['{'.$k.'}'] = $data[$k]['_parsed'];
141 141
 		}
142 142
 
143 143
 		$line = strtr($line, $replace);
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 		return [
302 302
 			'type' => $member->getTypeName(),
303 303
 			'id' => $member->getUserId(),
304
-			'name' => $member->getCachedName() . ' (' . $member->getTypeString() . ')',
304
+			'name' => $member->getCachedName().' ('.$member->getTypeString().')',
305 305
 			'_parsed' => $member->getCachedName()
306 306
 		];
307 307
 	}
@@ -336,8 +336,8 @@  discard block
 block discarded – undo
336 336
 		return [
337 337
 			'type' => 'circle',
338 338
 			'id' => $link->getUniqueId(),
339
-			'name' => $link->getToken() . '@' . $link->getAddress(),
340
-			'_parsed' => $link->getToken() . '@' . $link->getAddress()
339
+			'name' => $link->getToken().'@'.$link->getAddress(),
340
+			'_parsed' => $link->getToken().'@'.$link->getAddress()
341 341
 		];
342 342
 	}
343 343
 
Please login to merge, or discard this patch.
lib/Service/ConfigService.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 			return $value;
194 194
 		}
195 195
 
196
-		if (($value = $this->config->getSystemValue(Application::APP_ID . '.' . $key, '')) !== '') {
196
+		if (($value = $this->config->getSystemValue(Application::APP_ID.'.'.$key, '')) !== '') {
197 197
 			return $value;
198 198
 		}
199 199
 
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
 	 */
413 413
 	public function getTrustedDomains(): array {
414 414
 		return array_map(
415
-			function (string $address) {
415
+			function(string $address) {
416 416
 				return strtolower($address);
417 417
 			}, $this->config->getSystemValue('trusted_domains', [])
418 418
 		);
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
 		}
449 449
 
450 450
 		if (array_key_exists('port', $loopback)) {
451
-			$loopbackCloudId = $loopback['host'] . ':' . $loopback['port'];
451
+			$loopbackCloudId = $loopback['host'].':'.$loopback['port'];
452 452
 		} else {
453 453
 			$loopbackCloudId = $loopback['host'];
454 454
 		}
@@ -477,12 +477,12 @@  discard block
 block discarded – undo
477 477
 			$scheme = $this->getAppValue(self::LOOPBACK_CLOUD_SCHEME);
478 478
 		}
479 479
 
480
-		$base = $scheme . '://' . $instance;
480
+		$base = $scheme.'://'.$instance;
481 481
 		if ($route === '') {
482 482
 			return $base;
483 483
 		}
484 484
 
485
-		return $base . $this->urlGenerator->linkToRoute($route, $args);
485
+		return $base.$this->urlGenerator->linkToRoute($route, $args);
486 486
 	}
487 487
 
488 488
 
@@ -582,7 +582,7 @@  discard block
 block discarded – undo
582 582
 	public function displayFederatedUser(IFederatedUser $federatedUser, bool $displayName = false): string {
583 583
 		$name = ($displayName) ? $federatedUser->getDisplayName() : $federatedUser->getUserId();
584 584
 
585
-		return $name . $this->displayInstance($federatedUser->getInstance(), true);
585
+		return $name.$this->displayInstance($federatedUser->getInstance(), true);
586 586
 	}
587 587
 
588 588
 	/**
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
 			return '';
597 597
 		}
598 598
 
599
-		return (($showAt) ? '@' : '') . $instance;
599
+		return (($showAt) ? '@' : '').$instance;
600 600
 	}
601 601
 
602 602
 
Please login to merge, or discard this patch.
lib/Service/FederatedEventService.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -245,16 +245,16 @@  discard block
 block discarded – undo
245 245
 		try {
246 246
 			$test = new ReflectionClass($class);
247 247
 		} catch (ReflectionException $e) {
248
-			throw new FederatedEventException('ReflectionException with ' . $class . ': ' . $e->getMessage());
248
+			throw new FederatedEventException('ReflectionException with '.$class.': '.$e->getMessage());
249 249
 		}
250 250
 
251 251
 		if (!in_array(IFederatedItem::class, $test->getInterfaceNames())) {
252
-			throw new FederatedEventException($class . ' does not implements IFederatedItem');
252
+			throw new FederatedEventException($class.' does not implements IFederatedItem');
253 253
 		}
254 254
 
255 255
 		$item = OC::$server->get($class);
256 256
 		if (!($item instanceof IFederatedItem)) {
257
-			throw new FederatedEventException($class . ' not an IFederatedItem');
257
+			throw new FederatedEventException($class.' not an IFederatedItem');
258 258
 		}
259 259
 
260 260
 		if ($item instanceof IFederatedItemHighSeverity) {
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
 			$knownInstances = $this->memberRequest->getMemberInstances($circle->getSingleId());
451 451
 			$instances = array_filter(
452 452
 				array_map(
453
-					function (RemoteInstance $instance) use ($knownInstances) {
453
+					function(RemoteInstance $instance) use ($knownInstances) {
454 454
 						if (!in_array($instance->getInstance(), $knownInstances)) {
455 455
 							return null;
456 456
 						}
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
 		if ($event->hasMember()
466 466
 			&& !$this->configService->isLocalInstance($event->getMember()->getInstance())) {
467 467
 			$currentInstances = array_map(
468
-				function (RemoteInstance $instance): string {
468
+				function(RemoteInstance $instance): string {
469 469
 					return $instance->getInstance();
470 470
 				}, $instances
471 471
 			);
Please login to merge, or discard this patch.