Completed
Pull Request — master (#1187)
by Maxence
39s
created
lib/Service/GSUpstreamService.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 			}
146 146
 		} catch (Exception $e) {
147 147
 			$this->miscService->log(
148
-				get_class($e) . ' on new event: ' . $e->getMessage() . ' - ' . json_encode($event), 1
148
+				get_class($e).' on new event: '.$e->getMessage().' - '.json_encode($event), 1
149 149
 			);
150 150
 			throw $e;
151 151
 		}
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
 	 * @throws RequestResultNotJsonException
216 216
 	 * @throws GlobalScaleEventException
217 217
 	 */
218
-	public function confirmEvent(GSEvent &$event): void {
218
+	public function confirmEvent(GSEvent & $event): void {
219 219
 		$this->signEvent($event);
220 220
 
221 221
 		$circle = $event->getDeprecatedCircle();
@@ -229,13 +229,13 @@  discard block
 block discarded – undo
229 229
 		$request->setDataSerialize($event);
230 230
 
231 231
 		$result = $this->retrieveJson($request);
232
-		$this->miscService->log('result ' . json_encode($result), 0);
232
+		$this->miscService->log('result '.json_encode($result), 0);
233 233
 		if ($this->getInt('status', $result) === 0) {
234 234
 			throw new GlobalScaleEventException($this->get('error', $result));
235 235
 		}
236 236
 
237 237
 		$updatedData = $this->getArray('event', $result);
238
-		$this->miscService->log('updatedEvent: ' . json_encode($updatedData), 0);
238
+		$this->miscService->log('updatedEvent: '.json_encode($updatedData), 0);
239 239
 		if (!empty($updatedData)) {
240 240
 			$updated = new GSEvent();
241 241
 			try {
Please login to merge, or discard this patch.
lib/Service/RemoteStreamService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 	public function getCachedRemoteInstance(string $instance): RemoteInstance {
331 331
 		$remoteInstance = $this->remoteRequest->getFromInstance($instance);
332 332
 		if ($remoteInstance->getType() === RemoteInstance::TYPE_UNKNOWN) {
333
-			throw new UnknownRemoteException($instance . ' is set as \'unknown\' in database');
333
+			throw new UnknownRemoteException($instance.' is set as \'unknown\' in database');
334 334
 		}
335 335
 
336 336
 		return $remoteInstance;
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
 	 * @throws RemoteNotFoundException
572 572
 	 * @throws RemoteUidException
573 573
 	 */
574
-	public function confirmValidRemote(RemoteInstance $remote, ?RemoteInstance &$stored = null): void {
574
+	public function confirmValidRemote(RemoteInstance $remote, ?RemoteInstance & $stored = null): void {
575 575
 		try {
576 576
 			$stored = $this->remoteRequest->getFromHref($remote->getId());
577 577
 		} catch (RemoteNotFoundException $e) {
Please login to merge, or discard this patch.
lib/Service/MaintenanceService.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -61,9 +61,9 @@  discard block
 block discarded – undo
61 61
 
62 62
 	public static $DELAY =
63 63
 		[
64
-			1 => 60,    // every minute
65
-			2 => 300,   // every 5 minutes
66
-			3 => 3600,  // every hour
64
+			1 => 60, // every minute
65
+			2 => 300, // every 5 minutes
66
+			3 => 3600, // every hour
67 67
 			4 => 75400, // every day
68 68
 			5 => 432000 // evey week
69 69
 		];
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 		$this->federatedUserService->bypassCurrentUserCondition(true);
179 179
 
180 180
 		$this->lockMaintenanceRun();
181
-		$this->debug('running maintenance (' . $level . ')');
181
+		$this->debug('running maintenance ('.$level.')');
182 182
 
183 183
 		switch ($level) {
184 184
 			case 1:
@@ -349,14 +349,14 @@  discard block
 block discarded – undo
349 349
 			  ->includeSystemCircles();
350 350
 
351 351
 		$circles = array_map(
352
-			function (Circle $circle) {
352
+			function(Circle $circle) {
353 353
 				return $circle->getSingleId();
354 354
 			}, $this->circleRequest->getCircles(null, $probe)
355 355
 		);
356 356
 
357 357
 		$shares = array_unique(
358 358
 			array_map(
359
-				function (ShareWrapper $share) {
359
+				function(ShareWrapper $share) {
360 360
 					return $share->getSharedWith();
361 361
 				}, $this->shareWrapperRequest->getShares()
362 362
 			)
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
 	 */
502 502
 	private function output(string $message): void {
503 503
 		if (!is_null($this->output)) {
504
-			$this->output->writeln('- ' . $message);
504
+			$this->output->writeln('- '.$message);
505 505
 		}
506 506
 	}
507 507
 }
Please login to merge, or discard this patch.
lib/Command/CirclesCreate.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 		} catch (FederatedItemException $e) {
125 125
 			if ($input->getOption('status-code')) {
126 126
 				throw new FederatedItemException(
127
-					' [' . get_class($e) . ', ' . $e->getStatus() . ']' . "\n" . $e->getMessage()
127
+					' ['.get_class($e).', '.$e->getStatus().']'."\n".$e->getMessage()
128 128
 				);
129 129
 			}
130 130
 
@@ -136,9 +136,9 @@  discard block
 block discarded – undo
136 136
 		} elseif (strtolower($input->getOption('output')) !== 'none') {
137 137
 			/** @var Circle $circle */
138 138
 			$circle = $this->deserialize($outcome, Circle::class);
139
-			$output->writeln('Id: <info>' . $circle->getSingleId() . '</info>');
140
-			$output->writeln('Name: <info>' . $circle->getDisplayName() . '</info>');
141
-			$output->writeln('Owner: <info>' . $circle->getOwner()->getDisplayName() . '</info>');
139
+			$output->writeln('Id: <info>'.$circle->getSingleId().'</info>');
140
+			$output->writeln('Name: <info>'.$circle->getDisplayName().'</info>');
141
+			$output->writeln('Owner: <info>'.$circle->getOwner()->getDisplayName().'</info>');
142 142
 		}
143 143
 
144 144
 		return 0;
Please login to merge, or discard this patch.
lib/Model/ShareWrapper.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
 			$l10n = \OCP\Server::get(IFactory::class)->get('circles');
408 408
 			$display = $l10n->t('%s (Circle owned by %s)', [$display, $circle->getOwner()->getDisplayName()]);
409 409
 		} else {
410
-			$display .= ' (' . Circle::$DEF_SOURCE[$circle->getSource()] . ')';
410
+			$display .= ' ('.Circle::$DEF_SOURCE[$circle->getSource()].')';
411 411
 		}
412 412
 
413 413
 		$share->setSharedWithDisplayName($display);
@@ -504,20 +504,20 @@  discard block
 block discarded – undo
504 504
 
505 505
 	public function importFromDatabase(array $data, string $prefix = ''): IQueryRow {
506 506
 		$shareTime = new DateTime();
507
-		$shareTime->setTimestamp($this->getInt($prefix . 'stime', $data));
508
-
509
-		$this->setId($this->get($prefix . 'id', $data))
510
-			 ->setShareType($this->getInt($prefix . 'share_type', $data))
511
-			 ->setPermissions($this->getInt($prefix . 'permissions', $data))
512
-			 ->setItemType($this->get($prefix . 'item_type', $data))
513
-			 ->setItemSource($this->getInt($prefix . 'item_source', $data))
514
-			 ->setItemTarget($this->get($prefix . 'item_target', $data))
515
-			 ->setFileSource($this->getInt($prefix . 'file_source', $data))
516
-			 ->setFileTarget($this->get($prefix . 'file_target', $data))
517
-			 ->setSharedWith($this->get($prefix . 'share_with', $data))
518
-			 ->setSharedBy($this->get($prefix . 'uid_initiator', $data))
519
-			 ->setShareOwner($this->get($prefix . 'uid_owner', $data))
520
-			 ->setToken($this->get($prefix . 'token', $data))
507
+		$shareTime->setTimestamp($this->getInt($prefix.'stime', $data));
508
+
509
+		$this->setId($this->get($prefix.'id', $data))
510
+			 ->setShareType($this->getInt($prefix.'share_type', $data))
511
+			 ->setPermissions($this->getInt($prefix.'permissions', $data))
512
+			 ->setItemType($this->get($prefix.'item_type', $data))
513
+			 ->setItemSource($this->getInt($prefix.'item_source', $data))
514
+			 ->setItemTarget($this->get($prefix.'item_target', $data))
515
+			 ->setFileSource($this->getInt($prefix.'file_source', $data))
516
+			 ->setFileTarget($this->get($prefix.'file_target', $data))
517
+			 ->setSharedWith($this->get($prefix.'share_with', $data))
518
+			 ->setSharedBy($this->get($prefix.'uid_initiator', $data))
519
+			 ->setShareOwner($this->get($prefix.'uid_owner', $data))
520
+			 ->setToken($this->get($prefix.'token', $data))
521 521
 			 ->setShareTime($shareTime);
522 522
 
523 523
 //		if (($password = $this->get('personal_password', $data, '')) !== '') {
@@ -526,9 +526,9 @@  discard block
 block discarded – undo
526 526
 //			$share->setPassword($this->get('password', $data, ''));
527 527
 //		}
528 528
 
529
-		$this->setChildId($this->getInt($prefix . 'child_id', $data))
530
-			 ->setChildFileTarget($this->get($prefix . 'child_file_target', $data))
531
-			 ->setChildPermissions($this->getInt($prefix . 'child_permissions', $data))
529
+		$this->setChildId($this->getInt($prefix.'child_id', $data))
530
+			 ->setChildFileTarget($this->get($prefix.'child_file_target', $data))
531
+			 ->setChildPermissions($this->getInt($prefix.'child_permissions', $data))
532 532
 			 ->setProviderId(ShareByCircleProvider::IDENTIFIER)
533 533
 			 ->setStatus(Ishare::STATUS_ACCEPTED);
534 534
 
Please login to merge, or discard this patch.
lib/Service/ConfigService.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
 			return $value;
245 245
 		}
246 246
 
247
-		if (($value = $this->config->getSystemValue(Application::APP_ID . '.' . $key, '')) !== '') {
247
+		if (($value = $this->config->getSystemValue(Application::APP_ID.'.'.$key, '')) !== '') {
248 248
 			return $value;
249 249
 		}
250 250
 
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 	 */
479 479
 	public function getTrustedDomains(): array {
480 480
 		return array_map(
481
-			function (string $address) {
481
+			function(string $address) {
482 482
 				return strtolower($address);
483 483
 			}, $this->config->getSystemValue('trusted_domains', [])
484 484
 		);
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
 		}
515 515
 
516 516
 		if (array_key_exists('port', $loopback)) {
517
-			$loopbackCloudId = $loopback['host'] . ':' . $loopback['port'];
517
+			$loopbackCloudId = $loopback['host'].':'.$loopback['port'];
518 518
 		} else {
519 519
 			$loopbackCloudId = $loopback['host'];
520 520
 		}
@@ -553,13 +553,13 @@  discard block
 block discarded – undo
553 553
 			$path = $this->getAppValue(self::LOOPBACK_CLOUD_PATH);
554 554
 		}
555 555
 
556
-		$base = $scheme . '://' . $instance . $path;
556
+		$base = $scheme.'://'.$instance.$path;
557 557
 
558 558
 		if ($route === '') {
559 559
 			return $base;
560 560
 		}
561 561
 
562
-		return rtrim($base, '/') . $this->linkToRoute($route, $args);
562
+		return rtrim($base, '/').$this->linkToRoute($route, $args);
563 563
 	}
564 564
 
565 565
 
@@ -664,7 +664,7 @@  discard block
 block discarded – undo
664 664
 	): string {
665 665
 		$name = ($displayName) ? $federatedUser->getDisplayName() : $federatedUser->getUserId();
666 666
 		if ($federatedUser->getUserType() === Member::TYPE_MAIL) {
667
-			return $name . ' ' . $this->displayInstance(
667
+			return $name.' '.$this->displayInstance(
668 668
 				$federatedUser->getInstance(),
669 669
 				self::DISPLAY_PARENTHESIS
670 670
 			);
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
 			return $name;
675 675
 		}
676 676
 
677
-		return $name . $this->displayInstance($federatedUser->getInstance(), self::DISPLAY_AT);
677
+		return $name.$this->displayInstance($federatedUser->getInstance(), self::DISPLAY_AT);
678 678
 	}
679 679
 
680 680
 	/**
@@ -690,9 +690,9 @@  discard block
 block discarded – undo
690 690
 
691 691
 		switch ($type) {
692 692
 			case self::DISPLAY_AT:
693
-				return '@' . $instance;
693
+				return '@'.$instance;
694 694
 			case self::DISPLAY_PARENTHESIS:
695
-				return '(' . $instance . ')';
695
+				return '('.$instance.')';
696 696
 		}
697 697
 
698 698
 		return $instance;
Please login to merge, or discard this patch.
lib/Tools/Model/Request.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 	public function getInstance(): string {
258 258
 		$instance = $this->getHost();
259 259
 		if ($this->getPort() > 0) {
260
-			$instance .= ':' . $this->getPort();
260
+			$instance .= ':'.$this->getPort();
261 261
 		}
262 262
 
263 263
 		return $instance;
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
 		if ($protocol === null) {
282 282
 			if (strpos($url, '/') > -1) {
283 283
 				[$address, $baseUrl] = explode('/', $url, 2);
284
-				$this->setBaseUrl('/' . $baseUrl);
284
+				$this->setBaseUrl('/'.$baseUrl);
285 285
 			} else {
286 286
 				$address = $url;
287 287
 			}
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 				continue;
392 392
 			}
393 393
 
394
-			$url = str_replace(':' . $k, $this->data[$k], $url);
394
+			$url = str_replace(':'.$k, $this->data[$k], $url);
395 395
 		}
396 396
 
397 397
 		return $url;
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
 				continue;
409 409
 			}
410 410
 
411
-			$url = str_replace(':' . $k, $this->params[$k], $url);
411
+			$url = str_replace(':'.$k, $this->params[$k], $url);
412 412
 		}
413 413
 
414 414
 		return $url;
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
 	 * @return string
420 420
 	 */
421 421
 	public function getPath(): string {
422
-		return $this->baseUrl . $this->url;
422
+		return $this->baseUrl.$this->url;
423 423
 	}
424 424
 
425 425
 
@@ -436,9 +436,9 @@  discard block
 block discarded – undo
436 436
 	 * @return string
437 437
 	 */
438 438
 	public function getCompleteUrl(): string {
439
-		$port = ($this->getPort() > 0) ? ':' . $this->getPort() : '';
439
+		$port = ($this->getPort() > 0) ? ':'.$this->getPort() : '';
440 440
 
441
-		return $this->getUsedProtocol() . '://' . $this->getHost() . $port . $this->getParametersUrl();
441
+		return $this->getUsedProtocol().'://'.$this->getHost().$port.$this->getParametersUrl();
442 442
 	}
443 443
 
444 444
 
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
 	public function addHeader($key, $value): Request {
454 454
 		$header = $this->get($key, $this->headers);
455 455
 		if ($header !== '') {
456
-			$header .= ', ' . $value;
456
+			$header .= ', '.$value;
457 457
 		} else {
458 458
 			$header = $value;
459 459
 		}
@@ -683,11 +683,11 @@  discard block
 block discarded – undo
683 683
 
684 684
 		switch ($this->getQueryStringType()) {
685 685
 			case self::QS_VAR_ARRAY:
686
-				return '?' . http_build_query($this->getParams());
686
+				return '?'.http_build_query($this->getParams());
687 687
 
688 688
 			case self::QS_VAR_DUPLICATE:
689 689
 			default:
690
-				return '?' . preg_replace(
690
+				return '?'.preg_replace(
691 691
 					'/%5B(?:[0-9]|[1-9][0-9]+)%5D=/', '=', http_build_query($this->getParams())
692 692
 				);
693 693
 		}
Please login to merge, or discard this patch.
lib/Search/GlobalScaleUsers.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
 			RequestResultNotJsonException $e
92 92
 		) {
93 93
 			$this->miscService->log(
94
-				'Issue while search users from lookup: ' . get_class($e) . ' ' . $e->getMessage()
94
+				'Issue while search users from lookup: '.get_class($e).' '.$e->getMessage()
95 95
 			);
96 96
 
97 97
 			return [];
Please login to merge, or discard this patch.
lib/Db/DeprecatedCirclesRequestBuilder.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
 		}
246 246
 
247 247
 		$expr = $qb->expr();
248
-		$pf = '' . $this->default_select_alias . '.';
248
+		$pf = ''.$this->default_select_alias.'.';
249 249
 
250 250
 		/** @noinspection PhpMethodParametersCountMismatchInspection */
251 251
 		$qb->selectAlias('u.user_id', 'viewer_userid')
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 		   ->leftJoin(
260 260
 		   	$this->default_select_alias, DeprecatedRequestBuilder::TABLE_MEMBERS, 'u',
261 261
 		   	$expr->andX(
262
-		   		$expr->eq('u.circle_id', $pf . 'unique_id'),
262
+		   		$expr->eq('u.circle_id', $pf.'unique_id'),
263 263
 		   		$expr->eq('u.user_id', $qb->createNamedParameter($userId)),
264 264
 		   		$expr->eq('u.instance', $qb->createNamedParameter($instanceId)),
265 265
 		   		$expr->eq('u.user_type', $qb->createNamedParameter($type))
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
 		}
281 281
 
282 282
 		$expr = $qb->expr();
283
-		$pf = $this->default_select_alias . '.';
283
+		$pf = $this->default_select_alias.'.';
284 284
 
285 285
 		/** @noinspection PhpMethodParametersCountMismatchInspection */
286 286
 		$qb->selectAlias('o.user_id', 'owner_userid')
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
 		   ->leftJoin(
294 294
 		   	$this->default_select_alias, DeprecatedRequestBuilder::TABLE_MEMBERS, 'o',
295 295
 		   	$expr->andX(
296
-		   		$expr->eq('o.circle_id', $pf . 'unique_id'),
296
+		   		$expr->eq('o.circle_id', $pf.'unique_id'),
297 297
 		   		$expr->eq('o.level', $qb->createNamedParameter(DeprecatedMember::LEVEL_OWNER)),
298 298
 		   		$expr->eq('o.user_type', $qb->createNamedParameter(DeprecatedMember::TYPE_USER))
299 299
 		   	)
Please login to merge, or discard this patch.