Completed
Pull Request — master (#551)
by Maxence
02:10
created
lib/Model/Federated/RemoteInstance.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -49,11 +49,11 @@  discard block
 block discarded – undo
49 49
 
50 50
 	use TArrayTools;
51 51
 
52
-	const TYPE_UNKNOWN = 'Unknown';    // not trusted
53
-	const TYPE_PASSIVE = 'Passive';    // Minimum information about Federated Circles are broadcasted if a member belongs to the circle.
54
-	const TYPE_EXTERNAL = 'External';  // info about Federated Circles and their members are broadcasted  if a member belongs to the circle.
55
-	const TYPE_TRUSTED = 'Trusted';    // everything about Federated Circles are broadcasted.
56
-	const TYPE_GLOBAL_SCALE = 'GlobalScale';  // every Circle is broadcasted,
52
+	const TYPE_UNKNOWN = 'Unknown'; // not trusted
53
+	const TYPE_PASSIVE = 'Passive'; // Minimum information about Federated Circles are broadcasted if a member belongs to the circle.
54
+	const TYPE_EXTERNAL = 'External'; // info about Federated Circles and their members are broadcasted  if a member belongs to the circle.
55
+	const TYPE_TRUSTED = 'Trusted'; // everything about Federated Circles are broadcasted.
56
+	const TYPE_GLOBAL_SCALE = 'GlobalScale'; // every Circle is broadcasted,
57 57
 
58 58
 	public static $LIST_TYPE = [
59 59
 		self::TYPE_UNKNOWN,
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
 		];
408 408
 
409 409
 		if ($this->getAuthSigned() !== '') {
410
-			$data['auth-signed'] = $this->getAlgorithm() . ':' . $this->getAuthSigned();
410
+			$data['auth-signed'] = $this->getAlgorithm().':'.$this->getAuthSigned();
411 411
 		}
412 412
 
413 413
 		return array_filter(array_merge($data, parent::jsonSerialize()));
Please login to merge, or discard this patch.
lib/Service/ConfigService.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 		if ((!$this->isNonSSLLinksAllowed() || strpos($remote, 'http://') !== 0)
255 255
 			&& strpos($remote, 'https://') !== 0
256 256
 		) {
257
-			$remote = 'https://' . $remote;
257
+			$remote = 'https://'.$remote;
258 258
 		}
259 259
 
260 260
 		return rtrim($remote, '/');
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
 
525 525
 			if ($type !== self::GS_MOCKUP) {
526 526
 				throw new GSStatusException(
527
-					'GS and lookup are not configured : ' . $lookup . ', ' . $enabled
527
+					'GS and lookup are not configured : '.$lookup.', '.$enabled
528 528
 				);
529 529
 			}
530 530
 		}
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
 			}
594 594
 
595 595
 			if (array_key_exists('port', $local)) {
596
-				return $local['host'] . ':' . $local['port'];
596
+				return $local['host'].':'.$local['port'];
597 597
 			} else {
598 598
 				return $local['host'];
599 599
 			}
@@ -615,13 +615,13 @@  discard block
 block discarded – undo
615 615
 	 * @return string
616 616
 	 */
617 617
 	public function getRemotePath(string $route = 'circles.Navigation.navigate', array $args = []): string {
618
-		$base = $this->getAppValue(self::LOCAL_CLOUD_SCHEME) . '://' . $this->getLocalInstance();
618
+		$base = $this->getAppValue(self::LOCAL_CLOUD_SCHEME).'://'.$this->getLocalInstance();
619 619
 
620 620
 		if ($route === '') {
621 621
 			return $base;
622 622
 		}
623 623
 
624
-		return $base . $this->urlGenerator->linkToRoute($route, $args);
624
+		return $base.$this->urlGenerator->linkToRoute($route, $args);
625 625
 	}
626 626
 
627 627
 	/**
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
 			$ncBase = substr($ncBase, 0, -strlen($forcedPath));
725 725
 		}
726 726
 
727
-		return rtrim($ncBase, '/') . $link;
727
+		return rtrim($ncBase, '/').$link;
728 728
 	}
729 729
 
730 730
 }
Please login to merge, or discard this patch.
lib/Service/RemoteService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 			$loop++;
248 248
 			if ($loop > 10 || in_array($instance, $knownInstance)) {
249 249
 				throw new CircleNotFoundException(
250
-					'circle not found after browsing ' . implode(', ', $knownInstance)
250
+					'circle not found after browsing '.implode(', ', $knownInstance)
251 251
 				);
252 252
 			}
253 253
 			$knownInstance[] = $instance;
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 			['type' => Member::$DEF_TYPE[$type], 'userId' => $userId]
318 318
 		);
319 319
 
320
-		\OC::$server->getLogger()->log(3, '>> ' . json_encode($result));
320
+		\OC::$server->getLogger()->log(3, '>> '.json_encode($result));
321 321
 		if (empty($result)) {
322 322
 			throw new FederatedUserNotFoundException();
323 323
 		}
Please login to merge, or discard this patch.
lib/Command/MembersList.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -158,11 +158,11 @@  discard block
 block discarded – undo
158 158
 		if ($input->getOption('tree')) {
159 159
 			$this->federatedUserService->commandLineInitiator($initiator, $circleId, true);
160 160
 			$circle = $this->circleService->getCircle($circleId);
161
-			$output->writeln('<info>Name</info>: ' . $circle->getName());
161
+			$output->writeln('<info>Name</info>: '.$circle->getName());
162 162
 			$owner = $circle->getOwner();
163
-			$output->writeln('<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance());
163
+			$output->writeln('<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance());
164 164
 			$type = implode(", ", Circle::getCircleTypes($circle, Circle::TYPES_LONG));
165
-			$output->writeln('<info>Config</info>: ' . $type);
165
+			$output->writeln('<info>Config</info>: '.$type);
166 166
 			$output->writeln(' ');
167 167
 
168 168
 			$tree = new NC21TreeNode(null, new SimpleDataStore(['circle' => $circle]));
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
 		}
185 185
 
186 186
 		if ($input->getOption('json')) {
187
-			echo json_encode($members, JSON_PRETTY_PRINT) . "\n";
187
+			echo json_encode($members, JSON_PRETTY_PRINT)."\n";
188 188
 
189 189
 			return 0;
190 190
 		}
@@ -343,14 +343,14 @@  discard block
 block discarded – undo
343 343
 				$member = $data->gObj('member', Member::class);
344 344
 
345 345
 				if ($lineNumber === 1) {
346
-					$line .= '<info>' . $member->getUserId() . '</info>';
346
+					$line .= '<info>'.$member->getUserId().'</info>';
347 347
 					if (!$this->configService->isLocalInstance($member->getInstance())) {
348
-						$line .= '@' . $member->getInstance();
348
+						$line .= '@'.$member->getInstance();
349 349
 					}
350
-					$line .= ' (' . Member::$DEF_LEVEL[$member->getLevel()] . ')';
350
+					$line .= ' ('.Member::$DEF_LEVEL[$member->getLevel()].')';
351 351
 
352 352
 					if (!is_null($circle)) {
353
-						$line .= ' <info>Name</info>: ' . $circle->getName();
353
+						$line .= ' <info>Name</info>: '.$circle->getName();
354 354
 					}
355 355
 				}
356 356
 
@@ -363,16 +363,16 @@  discard block
 block discarded – undo
363 363
 						return $line;
364 364
 					}
365 365
 					$owner = $circle->getOwner();
366
-					$line .= '<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance();
366
+					$line .= '<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance();
367 367
 					$type = implode(", ", Circle::getCircleTypes($circle, Circle::TYPES_LONG));
368
-					$line .= ($type === '') ? '' : ' <info>Config</info>: ' . $type;
368
+					$line .= ($type === '') ? '' : ' <info>Config</info>: '.$type;
369 369
 				}
370 370
 
371 371
 			} else {
372 372
 				if ($lineNumber === 1 && !is_null($circle)) {
373
-					$line .= '<info>' . $circle->getId() . '</info>';
373
+					$line .= '<info>'.$circle->getId().'</info>';
374 374
 					if (!$this->configService->isLocalInstance($circle->getInstance())) {
375
-						$line .= '@' . $circle->getInstance();
375
+						$line .= '@'.$circle->getInstance();
376 376
 					}
377 377
 				}
378 378
 			}
Please login to merge, or discard this patch.
lib/Command/CirclesMemberships.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -169,10 +169,10 @@  discard block
 block discarded – undo
169 169
 		$type = Member::parseTypeString($input->getOption('type'));
170 170
 		$federatedUser = $this->federatedUserService->getFederatedUser($userId, (int)$type);
171 171
 
172
-		$output->writeln('Id: <info>' . $federatedUser->getUserId() . '</info>');
173
-		$output->writeln('Instance: <info>' . $federatedUser->getInstance() . '</info>');
174
-		$output->writeln('Type: <info>' . Member::$DEF_TYPE[$federatedUser->getUserType()] . '</info>');
175
-		$output->writeln('SingleId: <info>' . $federatedUser->getSingleId() . '</info>');
172
+		$output->writeln('Id: <info>'.$federatedUser->getUserId().'</info>');
173
+		$output->writeln('Instance: <info>'.$federatedUser->getInstance().'</info>');
174
+		$output->writeln('Type: <info>'.Member::$DEF_TYPE[$federatedUser->getUserType()].'</info>');
175
+		$output->writeln('SingleId: <info>'.$federatedUser->getSingleId().'</info>');
176 176
 
177 177
 
178 178
 		$output->writeln('');
@@ -181,14 +181,14 @@  discard block
 block discarded – undo
181 181
 		if ($count === 0) {
182 182
 			$output->writeln('(database not updated)');
183 183
 		} else {
184
-			$output->writeln('(' . $count . ' entries generated/updated in the database)');
184
+			$output->writeln('('.$count.' entries generated/updated in the database)');
185 185
 		}
186 186
 
187 187
 		foreach ($federatedUser->getMemberships() as $membership) {
188 188
 			$this->memberships[$membership->getCircleId()] = $membership;
189 189
 			$output->writeln(
190
-				'- <info>' . $membership->getCircleId() . '</info> ('
191
-				. Member::$DEF_LEVEL[$membership->getLevel()] . ')'
190
+				'- <info>'.$membership->getCircleId().'</info> ('
191
+				. Member::$DEF_LEVEL[$membership->getLevel()].')'
192 192
 			);
193 193
 		}
194 194
 
@@ -256,9 +256,9 @@  discard block
 block discarded – undo
256 256
 				if ($lineNumber === 2) {
257 257
 					return '';
258 258
 				}
259
-				$line .= '<info>' . $federatedUser->getSingleId() . '</info>';
259
+				$line .= '<info>'.$federatedUser->getSingleId().'</info>';
260 260
 				if (!$this->configService->isLocalInstance($federatedUser->getInstance())) {
261
-					$line .= '@' . $federatedUser->getInstance();
261
+					$line .= '@'.$federatedUser->getInstance();
262 262
 				}
263 263
 
264 264
 				return $line;
@@ -270,24 +270,24 @@  discard block
 block discarded – undo
270 270
 				$circle = $member->getCircle();
271 271
 
272 272
 				if ($lineNumber === 1) {
273
-					$line .= '<info>' . $circle->getId() . '</info>';
273
+					$line .= '<info>'.$circle->getId().'</info>';
274 274
 					if (!$this->configService->isLocalInstance($circle->getInstance())) {
275
-						$line .= '@' . $circle->getInstance();
275
+						$line .= '@'.$circle->getInstance();
276 276
 					}
277
-					$line .= ' (' . $circle->getName() . ')';
278
-					$line .= ' <info>Level</info>: ' . Member::$DEF_LEVEL[$member->getLevel()];
277
+					$line .= ' ('.$circle->getName().')';
278
+					$line .= ' <info>Level</info>: '.Member::$DEF_LEVEL[$member->getLevel()];
279 279
 
280 280
 					$knownMembership = $this->memberships[$member->getCircleId()];
281 281
 					if ($member->getLevel() !== $knownMembership->getLevel()) {
282
-						$line .= ' (' . Member::$DEF_LEVEL[$knownMembership->getLevel()] . ')';
282
+						$line .= ' ('.Member::$DEF_LEVEL[$knownMembership->getLevel()].')';
283 283
 					}
284 284
 				}
285 285
 
286 286
 				if ($lineNumber === 2) {
287 287
 					$owner = $circle->getOwner();
288
-					$line .= '<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance() . ' ';
288
+					$line .= '<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance().' ';
289 289
 					$type = implode(", ", Circle::getCircleTypes($circle, Circle::TYPES_LONG));
290
-					$line .= ($type === '') ? '' : '<info>Config</info>: ' . $type;
290
+					$line .= ($type === '') ? '' : '<info>Config</info>: '.$type;
291 291
 				}
292 292
 
293 293
 				return $line;
Please login to merge, or discard this patch.
lib/Db/CoreQueryBuilder.php 1 patch
Spacing   +66 added lines, -66 removed lines patch added patch discarded remove patch
@@ -163,16 +163,16 @@  discard block
 block discarded – undo
163 163
 		$this->generateMemberSelectAlias($alias, self::PREFIX_MEMBER)
164 164
 			 ->leftJoin(
165 165
 				 $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $alias,
166
-				 $expr->eq($alias . '.circle_id', $this->getDefaultSelectAlias() . '.unique_id')
166
+				 $expr->eq($alias.'.circle_id', $this->getDefaultSelectAlias().'.unique_id')
167 167
 			 );
168 168
 
169 169
 		// TODO: Check in big table if it is better to put condition in andWhere() or in LeftJoin()
170 170
 		$this->andWhere(
171 171
 			$expr->andX(
172
-				$expr->eq($alias . '.user_id', $this->createNamedParameter($member->getUserId())),
173
-				$expr->eq($alias . '.user_type', $this->createNamedParameter($member->getUserType())),
174
-				$expr->eq($alias . '.instance', $this->createNamedParameter($this->getInstance($member))),
175
-				$expr->gte($alias . '.level', $this->createNamedParameter($level))
172
+				$expr->eq($alias.'.user_id', $this->createNamedParameter($member->getUserId())),
173
+				$expr->eq($alias.'.user_type', $this->createNamedParameter($member->getUserType())),
174
+				$expr->eq($alias.'.instance', $this->createNamedParameter($this->getInstance($member))),
175
+				$expr->gte($alias.'.level', $this->createNamedParameter($level))
176 176
 			)
177 177
 		);
178 178
 	}
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
 			 ->leftJoin(
194 194
 				 $this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_CIRCLE, $alias,
195 195
 				 $expr->andX(
196
-					 $expr->eq($alias . '.unique_id', $this->getDefaultSelectAlias() . '.circle_id')
196
+					 $expr->eq($alias.'.unique_id', $this->getDefaultSelectAlias().'.circle_id')
197 197
 				 )
198 198
 			 );
199 199
 
@@ -223,8 +223,8 @@  discard block
 block discarded – undo
223 223
 			 ->leftJoin(
224 224
 				 $circleTableAlias, CoreRequestBuilder::TABLE_MEMBER, $alias,
225 225
 				 $expr->andX(
226
-					 $expr->eq($alias . '.circle_id', $circleTableAlias . '.unique_id'),
227
-					 $expr->eq($alias . '.level', $this->createNamedParameter(Member::LEVEL_OWNER))
226
+					 $expr->eq($alias.'.circle_id', $circleTableAlias.'.unique_id'),
227
+					 $expr->eq($alias.'.level', $this->createNamedParameter(Member::LEVEL_OWNER))
228 228
 				 )
229 229
 			 );
230 230
 	}
@@ -250,11 +250,11 @@  discard block
 block discarded – undo
250 250
 			 ->leftJoin(
251 251
 				 $aliasCircle, CoreRequestBuilder::TABLE_MEMBER, $alias,
252 252
 				 $expr->andX(
253
-					 $expr->eq($alias . '.circle_id', $aliasCircle . '.unique_id'),
254
-					 $expr->eq($alias . '.user_id', $this->createNamedParameter($initiator->getUserId())),
255
-					 $expr->eq($alias . '.user_type', $this->createNamedParameter($initiator->getUserType())),
253
+					 $expr->eq($alias.'.circle_id', $aliasCircle.'.unique_id'),
254
+					 $expr->eq($alias.'.user_id', $this->createNamedParameter($initiator->getUserId())),
255
+					 $expr->eq($alias.'.user_type', $this->createNamedParameter($initiator->getUserType())),
256 256
 					 $expr->eq(
257
-						 $alias . '.instance', $this->createNamedParameter($this->getInstance($initiator))
257
+						 $alias.'.instance', $this->createNamedParameter($this->getInstance($initiator))
258 258
 					 )
259 259
 				 )
260 260
 			 );
@@ -280,9 +280,9 @@  discard block
 block discarded – undo
280 280
 		$this->leftJoin(
281 281
 			$this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $alias,
282 282
 			$expr->andX(
283
-				$expr->eq($alias . '.circle_id', $aliasCircle . '.unique_id'),
284
-				$expr->eq($alias . '.instance', $this->createNamedParameter($instance)),
285
-				$expr->gte($alias . '.level', $this->createNamedParameter(Member::LEVEL_MEMBER))
283
+				$expr->eq($alias.'.circle_id', $aliasCircle.'.unique_id'),
284
+				$expr->eq($alias.'.instance', $this->createNamedParameter($instance)),
285
+				$expr->gte($alias.'.level', $this->createNamedParameter(Member::LEVEL_MEMBER))
286 286
 			)
287 287
 		);
288 288
 	}
@@ -307,17 +307,17 @@  discard block
 block discarded – undo
307 307
 		$this->leftJoin(
308 308
 			$this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $alias,
309 309
 			$expr->andX(
310
-				$expr->eq($alias . '.single_id', $aliasCircle . '.unique_id'),
311
-				$expr->emptyString($alias . '.instance'),
312
-				$expr->gte($alias . '.level', $this->createNamedParameter(Member::LEVEL_MEMBER))
310
+				$expr->eq($alias.'.single_id', $aliasCircle.'.unique_id'),
311
+				$expr->emptyString($alias.'.instance'),
312
+				$expr->gte($alias.'.level', $this->createNamedParameter(Member::LEVEL_MEMBER))
313 313
 			)
314 314
 		);
315 315
 		$this->leftJoin(
316 316
 			$this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_MEMBER, $aliasRemoteOwner,
317 317
 			$expr->andX(
318
-				$expr->eq($alias . '.circle_id', $aliasRemoteOwner . '.circle_id'),
319
-				$expr->eq($aliasRemoteOwner . '.instance', $this->createNamedParameter($instance)),
320
-				$expr->eq($aliasRemoteOwner . '.level', $this->createNamedParameter(Member::LEVEL_OWNER))
318
+				$expr->eq($alias.'.circle_id', $aliasRemoteOwner.'.circle_id'),
319
+				$expr->eq($aliasRemoteOwner.'.instance', $this->createNamedParameter($instance)),
320
+				$expr->eq($aliasRemoteOwner.'.level', $this->createNamedParameter(Member::LEVEL_OWNER))
321 321
 			)
322 322
 		);
323 323
 	}
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
 		$expr = $this->expr();
338 338
 		$this->leftJoin(
339 339
 			$this->getDefaultSelectAlias(), CoreRequestBuilder::TABLE_REMOTE, $alias,
340
-			$expr->eq($alias . '.instance', $this->createNamedParameter($instance))
340
+			$expr->eq($alias.'.instance', $this->createNamedParameter($instance))
341 341
 		);
342 342
 	}
343 343
 
@@ -356,15 +356,15 @@  discard block
 block discarded – undo
356 356
 		// - 4 (Visible to everyone)
357 357
 		$orX = $expr->orX();
358 358
 		$orX->add(
359
-			$expr->andX($expr->gte($alias . '.level', $this->createNamedParameter(Member::LEVEL_MEMBER)))
359
+			$expr->andX($expr->gte($alias.'.level', $this->createNamedParameter(Member::LEVEL_MEMBER)))
360 360
 		);
361 361
 		$orX->add(
362 362
 			$expr->andX(
363
-				$expr->bitwiseAnd($aliasCircle . '.config', Circle::CFG_PERSONAL),
364
-				$expr->eq($alias . '.level', $this->createNamedParameter(Member::LEVEL_OWNER))
363
+				$expr->bitwiseAnd($aliasCircle.'.config', Circle::CFG_PERSONAL),
364
+				$expr->eq($alias.'.level', $this->createNamedParameter(Member::LEVEL_OWNER))
365 365
 			)
366 366
 		);
367
-		$orX->add($expr->bitwiseAnd($aliasCircle . '.config', Circle::CFG_VISIBLE));
367
+		$orX->add($expr->bitwiseAnd($aliasCircle.'.config', Circle::CFG_VISIBLE));
368 368
 		$this->andWhere($orX);
369 369
 
370 370
 
@@ -399,10 +399,10 @@  discard block
 block discarded – undo
399 399
 		$expr = $this->expr();
400 400
 
401 401
 		$orHidden = $expr->orX();
402
-		$orHidden->add($expr->bitwiseAnd($alias . '.config', Circle::CFG_SINGLE));
403
-		$orHidden->add($expr->bitwiseAnd($alias . '.config', Circle::CFG_HIDDEN));
404
-		$orHidden->add($expr->bitwiseAnd($alias . '.config', Circle::CFG_BACKEND));
405
-		$this->andWhere($this->createFunction('NOT') . $orHidden);
402
+		$orHidden->add($expr->bitwiseAnd($alias.'.config', Circle::CFG_SINGLE));
403
+		$orHidden->add($expr->bitwiseAnd($alias.'.config', Circle::CFG_HIDDEN));
404
+		$orHidden->add($expr->bitwiseAnd($alias.'.config', Circle::CFG_BACKEND));
405
+		$this->andWhere($this->createFunction('NOT').$orHidden);
406 406
 	}
407 407
 
408 408
 
@@ -435,16 +435,16 @@  discard block
 block discarded – undo
435 435
 
436 436
 		$orX = $expr->orX();
437 437
 		$orX->add(
438
-			$expr->eq($alias . '.type', $this->createNamedParameter(RemoteInstance::TYPE_GLOBAL_SCALE))
438
+			$expr->eq($alias.'.type', $this->createNamedParameter(RemoteInstance::TYPE_GLOBAL_SCALE))
439 439
 		);
440 440
 
441 441
 		$orExtOrPassive = $expr->orX();
442 442
 		$orExtOrPassive->add(
443
-			$expr->eq($alias . '.type', $this->createNamedParameter(RemoteInstance::TYPE_EXTERNAL))
443
+			$expr->eq($alias.'.type', $this->createNamedParameter(RemoteInstance::TYPE_EXTERNAL))
444 444
 		);
445 445
 		if (!$sensitive) {
446 446
 			$orExtOrPassive->add(
447
-				$expr->eq($alias . '.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE))
447
+				$expr->eq($alias.'.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE))
448 448
 			);
449 449
 		} else {
450 450
 			if ($this->getDefaultSelectAlias() === 'm') {
@@ -454,8 +454,8 @@  discard block
 block discarded – undo
454 454
 
455 455
 
456 456
 		$orInstance = $expr->orX();
457
-		$orInstance->add($expr->isNotNull($aliasMembers . '.instance'));
458
-		$orInstance->add($expr->isNotNull($aliasRemoteOwner . '.instance'));
457
+		$orInstance->add($expr->isNotNull($aliasMembers.'.instance'));
458
+		$orInstance->add($expr->isNotNull($aliasRemoteOwner.'.instance'));
459 459
 
460 460
 		$andExternal = $expr->andX();
461 461
 		$andExternal->add($orExtOrPassive);
@@ -464,13 +464,13 @@  discard block
 block discarded – undo
464 464
 		$orExtOrTrusted = $expr->orX();
465 465
 		$orExtOrTrusted->add($andExternal);
466 466
 		$orExtOrTrusted->add(
467
-			$expr->eq($alias . '.type', $this->createNamedParameter(RemoteInstance::TYPE_TRUSTED))
467
+			$expr->eq($alias.'.type', $this->createNamedParameter(RemoteInstance::TYPE_TRUSTED))
468 468
 		);
469 469
 
470 470
 		$andTrusted = $expr->andX();
471 471
 		$andTrusted->add($orExtOrTrusted);
472
-		$andTrusted->add($expr->bitwiseAnd($aliasCircle . '.config', Circle::CFG_FEDERATED));
473
-		$andTrusted->add($expr->emptyString($aliasOwner . '.instance'));
472
+		$andTrusted->add($expr->bitwiseAnd($aliasCircle.'.config', Circle::CFG_FEDERATED));
473
+		$andTrusted->add($expr->emptyString($aliasOwner.'.instance'));
474 474
 		$orX->add($andTrusted);
475 475
 
476 476
 		$this->andWhere($orX);
@@ -488,21 +488,21 @@  discard block
 block discarded – undo
488 488
 		$expr = $this->expr();
489 489
 		$andPassive = $expr->andX();
490 490
 		$andPassive->add(
491
-			$expr->eq($alias . '.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE))
491
+			$expr->eq($alias.'.type', $this->createNamedParameter(RemoteInstance::TYPE_PASSIVE))
492 492
 		);
493 493
 
494 494
 		$orMemberOrLevel = $expr->orX();
495 495
 		$orMemberOrLevel->add(
496
-			$expr->eq($this->getDefaultSelectAlias() . '.instance', $alias . '.instance')
496
+			$expr->eq($this->getDefaultSelectAlias().'.instance', $alias.'.instance')
497 497
 		);
498 498
 		// TODO: do we need this ? (display members from the local instance)
499 499
 		$orMemberOrLevel->add(
500
-			$expr->emptyString($this->getDefaultSelectAlias() . '.instance')
500
+			$expr->emptyString($this->getDefaultSelectAlias().'.instance')
501 501
 		);
502 502
 
503 503
 		$orMemberOrLevel->add(
504 504
 			$expr->eq(
505
-				$this->getDefaultSelectAlias() . '.level',
505
+				$this->getDefaultSelectAlias().'.level',
506 506
 				$this->createNamedParameter(Member::LEVEL_OWNER)
507 507
 			)
508 508
 		);
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
 	 * @param int $flag
517 517
 	 */
518 518
 	public function filterConfig(int $flag): void {
519
-		$this->andWhere($this->expr()->bitwiseAnd($this->getDefaultSelectAlias() . '.config', $flag));
519
+		$this->andWhere($this->expr()->bitwiseAnd($this->getDefaultSelectAlias().'.config', $flag));
520 520
 	}
521 521
 
522 522
 
@@ -527,15 +527,15 @@  discard block
 block discarded – undo
527 527
 	 * @return $this
528 528
 	 */
529 529
 	private function generateCircleSelectAlias(string $alias, string $prefix): self {
530
-		$this->selectAlias($alias . '.unique_id', $prefix . 'unique_id')
531
-			 ->selectAlias($alias . '.name', $prefix . 'name')
532
-			 ->selectAlias($alias . '.alt_name', $prefix . 'alt_name')
533
-			 ->selectAlias($alias . '.description', $prefix . 'description')
534
-			 ->selectAlias($alias . '.settings', $prefix . 'settings')
535
-			 ->selectAlias($alias . '.config', $prefix . 'config')
536
-			 ->selectAlias($alias . '.contact_addressbook', $prefix . 'contact_addressbook')
537
-			 ->selectAlias($alias . '.contact_groupname', $prefix . 'contact_groupname')
538
-			 ->selectAlias($alias . '.creation', $prefix . 'creation');
530
+		$this->selectAlias($alias.'.unique_id', $prefix.'unique_id')
531
+			 ->selectAlias($alias.'.name', $prefix.'name')
532
+			 ->selectAlias($alias.'.alt_name', $prefix.'alt_name')
533
+			 ->selectAlias($alias.'.description', $prefix.'description')
534
+			 ->selectAlias($alias.'.settings', $prefix.'settings')
535
+			 ->selectAlias($alias.'.config', $prefix.'config')
536
+			 ->selectAlias($alias.'.contact_addressbook', $prefix.'contact_addressbook')
537
+			 ->selectAlias($alias.'.contact_groupname', $prefix.'contact_groupname')
538
+			 ->selectAlias($alias.'.creation', $prefix.'creation');
539 539
 
540 540
 		return $this;
541 541
 	}
@@ -547,20 +547,20 @@  discard block
 block discarded – undo
547 547
 	 * @return $this
548 548
 	 */
549 549
 	private function generateMemberSelectAlias(string $alias, string $prefix): self {
550
-		$this->selectAlias($alias . '.circle_id', $prefix . 'circle_id')
551
-			 ->selectAlias($alias . '.single_id', $prefix . 'single_id')
552
-			 ->selectAlias($alias . '.user_id', $prefix . 'user_id')
553
-			 ->selectAlias($alias . '.user_type', $prefix . 'user_type')
554
-			 ->selectAlias($alias . '.member_id', $prefix . 'member_id')
555
-			 ->selectAlias($alias . '.instance', $prefix . 'instance')
556
-			 ->selectAlias($alias . '.cached_name', $prefix . 'cached_name')
557
-			 ->selectAlias($alias . '.cached_update', $prefix . 'cached_update')
558
-			 ->selectAlias($alias . '.status', $prefix . 'status')
559
-			 ->selectAlias($alias . '.level', $prefix . 'level')
560
-			 ->selectAlias($alias . '.note', $prefix . 'note')
561
-			 ->selectAlias($alias . '.contact_id', $prefix . 'contact_id')
562
-			 ->selectAlias($alias . '.contact_meta', $prefix . 'contact_meta')
563
-			 ->selectAlias($alias . '.joined', $prefix . 'joined');
550
+		$this->selectAlias($alias.'.circle_id', $prefix.'circle_id')
551
+			 ->selectAlias($alias.'.single_id', $prefix.'single_id')
552
+			 ->selectAlias($alias.'.user_id', $prefix.'user_id')
553
+			 ->selectAlias($alias.'.user_type', $prefix.'user_type')
554
+			 ->selectAlias($alias.'.member_id', $prefix.'member_id')
555
+			 ->selectAlias($alias.'.instance', $prefix.'instance')
556
+			 ->selectAlias($alias.'.cached_name', $prefix.'cached_name')
557
+			 ->selectAlias($alias.'.cached_update', $prefix.'cached_update')
558
+			 ->selectAlias($alias.'.status', $prefix.'status')
559
+			 ->selectAlias($alias.'.level', $prefix.'level')
560
+			 ->selectAlias($alias.'.note', $prefix.'note')
561
+			 ->selectAlias($alias.'.contact_id', $prefix.'contact_id')
562
+			 ->selectAlias($alias.'.contact_meta', $prefix.'contact_meta')
563
+			 ->selectAlias($alias.'.joined', $prefix.'joined');
564 564
 
565 565
 		return $this;
566 566
 	}
Please login to merge, or discard this patch.
lib/Db/MemberRequest.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -174,8 +174,8 @@
 block discarded – undo
174 174
 			$qb->limitToRemoteInstance($remoteInstance->getInstance(), true);
175 175
 		}
176 176
 
177
-		$qb->orderBy($qb->getDefaultSelectAlias() . '.level', 'desc');
178
-		$qb->addOrderBy($qb->getDefaultSelectAlias() . '.cached_name', 'asc');
177
+		$qb->orderBy($qb->getDefaultSelectAlias().'.level', 'desc');
178
+		$qb->addOrderBy($qb->getDefaultSelectAlias().'.cached_name', 'asc');
179 179
 
180 180
 		return $this->getItemsFromRequest($qb);
181 181
 	}
Please login to merge, or discard this patch.
lib/Model/Circle.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -82,23 +82,23 @@  discard block
 block discarded – undo
82 82
 
83 83
 
84 84
 	// specific value
85
-	const CFG_CIRCLE = 0;        // only for code readability. Circle is locked by default.
86
-	const CFG_SINGLE = 1;        // Circle with only one single member.
87
-	const CFG_PERSONAL = 2;      // Personal circle, only the owner can see it.
85
+	const CFG_CIRCLE = 0; // only for code readability. Circle is locked by default.
86
+	const CFG_SINGLE = 1; // Circle with only one single member.
87
+	const CFG_PERSONAL = 2; // Personal circle, only the owner can see it.
88 88
 
89 89
 	// bitwise
90
-	const CFG_SYSTEM = 4;         // System Circl (not managed by the official front-end). Meaning some config are limited
91
-	const CFG_VISIBLE = 8;        // Visible to everyone, if not visible, people have to know its name to be able to find it
92
-	const CFG_OPEN = 16;          // Circle is open, people can join
93
-	const CFG_INVITE = 32;        // Adding a member generate an invitation that needs to be accepted
94
-	const CFG_REQUEST = 64;       // Request to join Circles needs to be confirmed by a moderator
95
-	const CFG_FRIEND = 128;       // Members of the circle can invite their friends
96
-	const CFG_PROTECTED = 256;    // Password protected to join/request
97
-	const CFG_NO_OWNER = 512;     // no owner, only members
98
-	const CFG_HIDDEN = 1024;      // hidden from listing, but available as a share entity
99
-	const CFG_BACKEND = 2048;     // Fully hidden, only backend Circles
100
-	const CFG_ROOT = 4096;        // Circle cannot be inside another Circle
101
-	const CFG_FEDERATED = 8192;   // Federated
90
+	const CFG_SYSTEM = 4; // System Circl (not managed by the official front-end). Meaning some config are limited
91
+	const CFG_VISIBLE = 8; // Visible to everyone, if not visible, people have to know its name to be able to find it
92
+	const CFG_OPEN = 16; // Circle is open, people can join
93
+	const CFG_INVITE = 32; // Adding a member generate an invitation that needs to be accepted
94
+	const CFG_REQUEST = 64; // Request to join Circles needs to be confirmed by a moderator
95
+	const CFG_FRIEND = 128; // Members of the circle can invite their friends
96
+	const CFG_PROTECTED = 256; // Password protected to join/request
97
+	const CFG_NO_OWNER = 512; // no owner, only members
98
+	const CFG_HIDDEN = 1024; // hidden from listing, but available as a share entity
99
+	const CFG_BACKEND = 2048; // Fully hidden, only backend Circles
100
+	const CFG_ROOT = 4096; // Circle cannot be inside another Circle
101
+	const CFG_FEDERATED = 8192; // Federated
102 102
 
103 103
 
104 104
 	public static $DEF_CFG_MAX = 16383;
@@ -628,21 +628,21 @@  discard block
 block discarded – undo
628 628
 	 * @throws CircleNotFoundException
629 629
 	 */
630 630
 	public function importFromDatabase(array $data, string $prefix = ''): INC21QueryRow {
631
-		if (!array_key_exists($prefix . 'unique_id', $data)) {
631
+		if (!array_key_exists($prefix.'unique_id', $data)) {
632 632
 			throw new CircleNotFoundException();
633 633
 		}
634 634
 
635
-		$this->setId($this->get($prefix . 'unique_id', $data))
636
-			 ->setName($this->get($prefix . 'name', $data))
637
-			 ->setAltName($this->get($prefix . 'alt_name', $data))
638
-			 ->setConfig($this->getInt($prefix . 'config', $data))
639
-			 ->setInstance($this->get($prefix . 'instance', $data))
640
-			 ->setSettings($this->getArray($prefix . 'settings', $data))
641
-			 ->setContactAddressBook($this->getInt($prefix . 'contact_addressbook', $data))
642
-			 ->setContactGroupName($this->get($prefix . 'contact_groupname', $data))
643
-			 ->setDescription($this->get($prefix . 'description', $data));
644
-
645
-		$creation = $this->get($prefix . 'creation', $data);
635
+		$this->setId($this->get($prefix.'unique_id', $data))
636
+			 ->setName($this->get($prefix.'name', $data))
637
+			 ->setAltName($this->get($prefix.'alt_name', $data))
638
+			 ->setConfig($this->getInt($prefix.'config', $data))
639
+			 ->setInstance($this->get($prefix.'instance', $data))
640
+			 ->setSettings($this->getArray($prefix.'settings', $data))
641
+			 ->setContactAddressBook($this->getInt($prefix.'contact_addressbook', $data))
642
+			 ->setContactGroupName($this->get($prefix.'contact_groupname', $data))
643
+			 ->setDescription($this->get($prefix.'description', $data));
644
+
645
+		$creation = $this->get($prefix.'creation', $data);
646 646
 		$this->setCreation(DateTime::createFromFormat('Y-m-d H:i:s', $creation)->getTimestamp());
647 647
 
648 648
 		$this->getManager()->importOwnerFromDatabase($this, $data);
Please login to merge, or discard this patch.
lib/Command/CirclesConfig.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -182,8 +182,8 @@
 block discarded – undo
182 182
 			$value = array_search(strtoupper($item), $valid);
183 183
 			if (!$value) {
184 184
 				throw new InvalidArgumentException(
185
-					'Invalid config \'' . $item . '\'. Available values: '
186
-					. implode(', ', array_values($valid)) . '. '
185
+					'Invalid config \''.$item.'\'. Available values: '
186
+					. implode(', ', array_values($valid)).'. '
187 187
 					. 'To disable a config, start the value with an underscore'
188 188
 				);
189 189
 			}
Please login to merge, or discard this patch.