Completed
Pull Request — master (#586)
by Maxence
02:32
created
lib/Command/CirclesConfig.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 		} catch (FederatedItemException $e) {
145 145
 			if ($input->getOption('status-code')) {
146 146
 				throw new FederatedItemException(
147
-					' [' . get_class($e) . ', ' . $e->getStatus() . ']' . "\n" . $e->getMessage()
147
+					' ['.get_class($e).', '.$e->getStatus().']'."\n".$e->getMessage()
148 148
 				);
149 149
 			}
150 150
 
@@ -176,8 +176,8 @@  discard block
 block discarded – undo
176 176
 			$value = array_search(strtoupper($item), $valid);
177 177
 			if (!$value) {
178 178
 				throw new InvalidArgumentException(
179
-					'Invalid config \'' . $item . '\'. Available values: '
180
-					. implode(', ', array_values($valid)) . '. '
179
+					'Invalid config \''.$item.'\'. Available values: '
180
+					. implode(', ', array_values($valid)).'. '
181 181
 					. 'To disable a config, start the value with an underscore'
182 182
 				);
183 183
 			}
Please login to merge, or discard this patch.
lib/Command/CirclesCheck.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
 		$test->setAsync(true);
142 142
 		$token = $this->gsUpstreamService->newEvent($test);
143 143
 
144
-		$output->writeln('- Async request is sent, now waiting ' . $this->delay . ' seconds');
144
+		$output->writeln('- Async request is sent, now waiting '.$this->delay.' seconds');
145 145
 		sleep($this->delay);
146
-		$output->writeln('- Pause is over, checking results for ' . $token);
146
+		$output->writeln('- Pause is over, checking results for '.$token);
147 147
 
148 148
 		$wrappers = $this->gsUpstreamService->getEventsByToken($token);
149 149
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 
156 156
 		$localLooksGood = false;
157 157
 		foreach ($instances as $instance) {
158
-			$output->write($instance . ' ');
158
+			$output->write($instance.' ');
159 159
 			if (array_key_exists($instance, $result)
160 160
 				&& $result[$instance]->getResult()
161 161
 									 ->gInt('status') === 1) {
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 		$this->configService->configureRequest($request, $route, $args);
193 193
 		$request->setFollowLocation(false);
194 194
 
195
-		$o->write('- ' . $type . ' request on ' . $request->getCompleteUrl() . ': ');
195
+		$o->write('- '.$type.' request on '.$request->getCompleteUrl().': ');
196 196
 		$this->doRequest($request);
197 197
 
198 198
 		$color = 'error';
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
 			$color = 'info';
202 202
 		}
203 203
 
204
-		$o->writeln('<' . $color . '>' . $result->getStatusCode() . '</' . $color . '>');
204
+		$o->writeln('<'.$color.'>'.$result->getStatusCode().'</'.$color.'>');
205 205
 
206 206
 		if ($result->getStatusCode() === 200) {
207 207
 			return true;
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 
224 224
 		$output->writeln('');
225 225
 		$output->writeln(
226
-			'The address <info>' . $address . '</info> seems to reach your local Nextcloud.'
226
+			'The address <info>'.$address.'</info> seems to reach your local Nextcloud.'
227 227
 		);
228 228
 
229 229
 		$helper = $this->getHelper('question');
@@ -240,8 +240,8 @@  discard block
 block discarded – undo
240 240
 
241 241
 		$this->configService->setAppValue(ConfigService::FORCE_NC_BASE, $address);
242 242
 		$output->writeln(
243
-			'New configuration <info>' . Application::APP_ID . '.' . ConfigService::FORCE_NC_BASE . '=\''
244
-			. $address . '\'</info> stored in database'
243
+			'New configuration <info>'.Application::APP_ID.'.'.ConfigService::FORCE_NC_BASE.'=\''
244
+			. $address.'\'</info> stored in database'
245 245
 		);
246 246
 	}
247 247
 
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
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 				$recipient = $share->getInitiator();
223 223
 				$sharedTo = $recipient->getDisplayName();
224 224
 				if (!$this->configService->isLocalInstance($recipient->getInstance())) {
225
-					$sharedTo .= '@' . $recipient->getInstance();
225
+					$sharedTo .= '@'.$recipient->getInstance();
226 226
 				}
227 227
 			}
228 228
 			$circle = $share->getCircle();
@@ -232,15 +232,15 @@  discard block
 block discarded – undo
232 232
 				$share->getShareOwner(),
233 233
 				$share->getFileTarget(),
234 234
 				$share->getSharedBy(),
235
-				$circle->getDisplayName() . ' (' . $share->getSharedWith()
236
-				. ', ' . Circle::$DEF_SOURCE[$circle->getSource()] . ')'
235
+				$circle->getDisplayName().' ('.$share->getSharedWith()
236
+				. ', '.Circle::$DEF_SOURCE[$circle->getSource()].')'
237 237
 			];
238 238
 
239 239
 			if (!$filterRecipient) {
240 240
 				$row = array_merge(
241 241
 					$row, [
242
-							$sharedTo . ' (' . $recipient->getSingleId() . ', '
243
-							. Circle::$DEF_SOURCE[$recipient->getBasedOn()->getSource()] . ')',
242
+							$sharedTo.' ('.$recipient->getSingleId().', '
243
+							. Circle::$DEF_SOURCE[$recipient->getBasedOn()->getSource()].')',
244 244
 							(($share->getChildId() > 0) ? $share->getChildFileTarget(
245 245
 							) : $share->getFileTarget()),
246 246
 						]
Please login to merge, or discard this patch.
lib/Command/MembersList.php 1 patch
Spacing   +13 added lines, -14 removed lines patch added patch discarded remove patch
@@ -179,11 +179,11 @@  discard block
 block discarded – undo
179 179
 			$this->federatedUserService->commandLineInitiator($initiator, $circleId, true);
180 180
 			$circle = $this->circleService->getCircle($circleId);
181 181
 
182
-			$output->writeln('<info>Name</info>: ' . $circle->getName());
182
+			$output->writeln('<info>Name</info>: '.$circle->getName());
183 183
 			$owner = $circle->getOwner();
184
-			$output->writeln('<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance());
184
+			$output->writeln('<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance());
185 185
 			$type = implode(", ", Circle::getCircleFlags($circle, Circle::FLAGS_LONG));
186
-			$output->writeln('<info>Config</info>: ' . $type);
186
+			$output->writeln('<info>Config</info>: '.$type);
187 187
 			$output->writeln(' ');
188 188
 
189 189
 			$tree = new NC22TreeNode(null, new SimpleDataStore(['circle' => $circle]));
@@ -248,8 +248,7 @@  discard block
 block discarded – undo
248 248
 					($this->input->getOption('display-name')) ?
249 249
 						$member->getBasedOn()->getDisplayName() : $member->getUserId(),
250 250
 					($member->getInstance() === $local) ? '' : $member->getInstance(),
251
-					($level > 0) ? Member::$DEF_LEVEL[$level] :
252
-						'(' . strtolower($member->getStatus()) . ')'
251
+					($level > 0) ? Member::$DEF_LEVEL[$level] : '('.strtolower($member->getStatus()).')'
253 252
 				]
254 253
 			);
255 254
 		}
@@ -390,17 +389,17 @@  discard block
 block discarded – undo
390 389
 				$member = $data->gObj('member', Member::class);
391 390
 
392 391
 				if ($lineNumber === 1) {
393
-					$line .= '<info>' . $member->getSingleId() . '</info>';
392
+					$line .= '<info>'.$member->getSingleId().'</info>';
394 393
 					if (!$this->configService->isLocalInstance($member->getInstance())) {
395
-						$line .= '@' . $member->getInstance();
394
+						$line .= '@'.$member->getInstance();
396 395
 					}
397
-					$line .= ' (' . Member::$DEF_LEVEL[$member->getLevel()] . ')';
396
+					$line .= ' ('.Member::$DEF_LEVEL[$member->getLevel()].')';
398 397
 
399 398
 					$name = ($this->input->getOption('display-name')) ?
400 399
 						$member->getBasedOn()->getDisplayName() : $member->getUserId();
401
-					$line .= ' <info>Name</info>: ' . $name;
400
+					$line .= ' <info>Name</info>: '.$name;
402 401
 					$source = ($member->hasBasedOn()) ? $member->getBasedOn()->getSource() : '';
403
-					$line .= ' <info>Source</info>: ' . Circle::$DEF_SOURCE[$source];
402
+					$line .= ' <info>Source</info>: '.Circle::$DEF_SOURCE[$source];
404 403
 				}
405 404
 
406 405
 				if ($lineNumber === 2) {
@@ -412,16 +411,16 @@  discard block
 block discarded – undo
412 411
 						return $line;
413 412
 					}
414 413
 					$owner = $circle->getOwner();
415
-					$line .= '<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance();
414
+					$line .= '<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance();
416 415
 					$type = implode(", ", Circle::getCircleFlags($circle, Circle::FLAGS_LONG));
417
-					$line .= ($type === '') ? '' : ' <info>Config</info>: ' . $type;
416
+					$line .= ($type === '') ? '' : ' <info>Config</info>: '.$type;
418 417
 				}
419 418
 
420 419
 			} else {
421 420
 				if ($lineNumber === 1 && !is_null($circle)) {
422
-					$line .= '<info>' . $circle->getSingleId() . '</info>';
421
+					$line .= '<info>'.$circle->getSingleId().'</info>';
423 422
 					if (!$this->configService->isLocalInstance($circle->getInstance())) {
424
-						$line .= '@' . $circle->getInstance();
423
+						$line .= '@'.$circle->getInstance();
425 424
 					}
426 425
 				}
427 426
 			}
Please login to merge, or discard this patch.
lib/Command/CirclesMemberships.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -213,10 +213,10 @@  discard block
 block discarded – undo
213 213
 			return 0;
214 214
 		}
215 215
 
216
-		$output->writeln('Id: <info>' . $federatedUser->getUserId() . '</info>');
217
-		$output->writeln('Instance: <info>' . $federatedUser->getInstance() . '</info>');
218
-		$output->writeln('Type: <info>' . Member::$TYPE[$federatedUser->getUserType()] . '</info>');
219
-		$output->writeln('SingleId: <info>' . $federatedUser->getSingleId() . '</info>');
216
+		$output->writeln('Id: <info>'.$federatedUser->getUserId().'</info>');
217
+		$output->writeln('Instance: <info>'.$federatedUser->getInstance().'</info>');
218
+		$output->writeln('Type: <info>'.Member::$TYPE[$federatedUser->getUserType()].'</info>');
219
+		$output->writeln('SingleId: <info>'.$federatedUser->getSingleId().'</info>');
220 220
 
221 221
 		$output->writeln('');
222 222
 		$output->writeln('Memberships:');
@@ -225,14 +225,14 @@  discard block
 block discarded – undo
225 225
 		if ($count === 0) {
226 226
 			$output->writeln('(database not updated)');
227 227
 		} else {
228
-			$output->writeln('(' . $count . ' entries generated/updated in the database)');
228
+			$output->writeln('('.$count.' entries generated/updated in the database)');
229 229
 		}
230 230
 
231 231
 		foreach ($federatedUser->getMemberships() as $membership) {
232 232
 			$this->memberships[$membership->getCircleId()] = $membership;
233 233
 			$output->writeln(
234
-				'- <info>' . $membership->getCircleId() . '</info> ('
235
-				. Member::$DEF_LEVEL[$membership->getLevel()] . ')'
234
+				'- <info>'.$membership->getCircleId().'</info> ('
235
+				. Member::$DEF_LEVEL[$membership->getLevel()].')'
236 236
 			);
237 237
 		}
238 238
 
@@ -305,9 +305,9 @@  discard block
 block discarded – undo
305 305
 				if ($lineNumber === 2) {
306 306
 					return '';
307 307
 				}
308
-				$line .= '<info>' . $federatedUser->getSingleId() . '</info>';
308
+				$line .= '<info>'.$federatedUser->getSingleId().'</info>';
309 309
 				if (!$this->configService->isLocalInstance($federatedUser->getInstance())) {
310
-					$line .= '@' . $federatedUser->getInstance();
310
+					$line .= '@'.$federatedUser->getInstance();
311 311
 				}
312 312
 
313 313
 				return $line;
@@ -319,28 +319,28 @@  discard block
 block discarded – undo
319 319
 				$circle = $member->getCircle();
320 320
 
321 321
 				if ($lineNumber === 1) {
322
-					$line .= '<info>' . $circle->getSingleId() . '</info>';
322
+					$line .= '<info>'.$circle->getSingleId().'</info>';
323 323
 					if (!$this->configService->isLocalInstance($circle->getInstance())) {
324
-						$line .= '@' . $circle->getInstance();
324
+						$line .= '@'.$circle->getInstance();
325 325
 					}
326
-					$line .= ' (' . ($this->input->getOption('display-name') ?
327
-							$circle->getDisplayName() : $circle->getName()) . ')';
328
-					$line .= ' <info>MemberId</info>: ' . $member->getId();
329
-					$line .= ' <info>Level</info>: ' . Member::$DEF_LEVEL[$member->getLevel()];
326
+					$line .= ' ('.($this->input->getOption('display-name') ?
327
+							$circle->getDisplayName() : $circle->getName()).')';
328
+					$line .= ' <info>MemberId</info>: '.$member->getId();
329
+					$line .= ' <info>Level</info>: '.Member::$DEF_LEVEL[$member->getLevel()];
330 330
 
331 331
 					$knownMembership = $this->memberships[$member->getCircleId()];
332 332
 					if ($member->getLevel() !== $knownMembership->getLevel()) {
333
-						$line .= ' (' . Member::$DEF_LEVEL[$knownMembership->getLevel()] . ')';
333
+						$line .= ' ('.Member::$DEF_LEVEL[$knownMembership->getLevel()].')';
334 334
 					}
335 335
 				}
336 336
 				if ($lineNumber === 2) {
337 337
 					$owner = $circle->getOwner();
338
-					$line .= '<info>Owner</info>: ' . $owner->getUserId() . '@' . $owner->getInstance();
338
+					$line .= '<info>Owner</info>: '.$owner->getUserId().'@'.$owner->getInstance();
339 339
 					if ($owner->hasBasedOn()) {
340
-						$line .= ' (' . Circle::$DEF_SOURCE[$owner->getBasedOn()->getSource()] . ') ';
340
+						$line .= ' ('.Circle::$DEF_SOURCE[$owner->getBasedOn()->getSource()].') ';
341 341
 					}
342 342
 					$type = implode(", ", Circle::getCircleFlags($circle, Circle::FLAGS_LONG));
343
-					$line .= ($type === '') ? '' : '<info>Config</info>: ' . $type;
343
+					$line .= ($type === '') ? '' : '<info>Config</info>: '.$type;
344 344
 				}
345 345
 
346 346
 				return $line;
@@ -397,7 +397,7 @@  discard block
 block discarded – undo
397 397
 			);
398 398
 		}
399 399
 
400
-		$output->writeln($count . ' memberships updated');
400
+		$output->writeln($count.' memberships updated');
401 401
 	}
402 402
 
403 403
 }
Please login to merge, or discard this patch.
lib/Service/SyncService.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -280,7 +280,7 @@
 block discarded – undo
280 280
 	 */
281 281
 	public function groupDeleted(string $groupId): void {
282 282
 		$circle = new Circle();
283
-		$circle->setName('group:' . $groupId)
283
+		$circle->setName('group:'.$groupId)
284 284
 			   ->setConfig(Circle::CFG_SYSTEM | Circle::CFG_NO_OWNER | Circle::CFG_HIDDEN)
285 285
 			   ->setSource(Member::TYPE_GROUP);
286 286
 
Please login to merge, or discard this patch.
lib/Service/SharingFrameService.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 	public function createFrame($circleUniqueId, SharingFrame $frame, $broadcast = null) {
149 149
 
150 150
 		$this->miscService->log(
151
-			'Create frame with payload ' . json_encode($frame->getPayload()) . ' as ' . $this->userId, 0
151
+			'Create frame with payload '.json_encode($frame->getPayload()).' as '.$this->userId, 0
152 152
 		);
153 153
 		try {
154 154
 			$circle = $this->circlesRequest->getCircle($circleUniqueId, $this->userId);
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 			$this->initiateShare($circle->getUniqueId(), $frame->getUniqueId());
164 164
 		} catch (Exception $e) {
165 165
 			$this->miscService->log(
166
-				'fail to create frame for circle ' . $circleUniqueId . ' - ' . $e->getMessage()
166
+				'fail to create frame for circle '.$circleUniqueId.' - '.$e->getMessage()
167 167
 			);
168 168
 			throw $e;
169 169
 		}
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 			return true;
311 311
 		} catch (Exception $e) {
312 312
 			$this->miscService->log(
313
-				'fail to initialise circle share with request ' . json_encode($request) . ' - '
313
+				'fail to initialise circle share with request '.json_encode($request).' - '
314 314
 				. $e->getMessage(), 3
315 315
 			);
316 316
 			throw $e;
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
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 
254 254
 		$request = new NC22Request('', $type);
255 255
 		if ($this->configService->isLocalInstance($instance)) {
256
-			$this->configService->configureRequest($request, 'circles.Remote.' . $item, $params);
256
+			$this->configService->configureRequest($request, 'circles.Remote.'.$item, $params);
257 257
 		} else {
258 258
 			$this->configService->configureRequest($request);
259 259
 			$link = $this->getRemoteInstanceEntry($instance, $item, $params);
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 	public function getCachedRemoteInstance(string $instance): RemoteInstance {
319 319
 		$remoteInstance = $this->remoteRequest->getFromInstance($instance);
320 320
 		if ($remoteInstance->getType() === RemoteInstance::TYPE_UNKNOWN) {
321
-			throw new UnknownRemoteException($instance . ' is set as \'unknown\' in database');
321
+			throw new UnknownRemoteException($instance.' is set as \'unknown\' in database');
322 322
 		}
323 323
 
324 324
 		return $remoteInstance;
Please login to merge, or discard this patch.
lib/Service/ConfigService.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 			return $value;
123 123
 		}
124 124
 
125
-		if (($value = $this->config->getSystemValue('circles.' . $key, '')) !== '') {
125
+		if (($value = $this->config->getSystemValue('circles.'.$key, '')) !== '') {
126 126
 			return $value;
127 127
 		}
128 128
 
@@ -379,7 +379,7 @@  discard block
 block discarded – undo
379 379
 			}
380 380
 
381 381
 			if (array_key_exists('port', $frontal)) {
382
-				return $frontal['host'] . ':' . $frontal['port'];
382
+				return $frontal['host'].':'.$frontal['port'];
383 383
 			} else {
384 384
 				return $frontal['host'];
385 385
 			}
@@ -401,13 +401,13 @@  discard block
 block discarded – undo
401 401
 	 * @return string
402 402
 	 */
403 403
 	public function getFrontalPath(string $route = 'circles.Remote.appService', array $args = []): string {
404
-		$base = $this->getAppValue(self::FRONTAL_CLOUD_SCHEME) . '://' . $this->getFrontalInstance();
404
+		$base = $this->getAppValue(self::FRONTAL_CLOUD_SCHEME).'://'.$this->getFrontalInstance();
405 405
 
406 406
 		if ($route === '') {
407 407
 			return $base;
408 408
 		}
409 409
 
410
-		return $base . $this->urlGenerator->linkToRoute($route, $args);
410
+		return $base.$this->urlGenerator->linkToRoute($route, $args);
411 411
 	}
412 412
 
413 413
 	/**
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
 			$ncBase = substr($ncBase, 0, -strlen($forcedPath));
514 514
 		}
515 515
 
516
-		return rtrim($ncBase, '/') . $link;
516
+		return rtrim($ncBase, '/').$link;
517 517
 	}
518 518
 
519 519
 }
Please login to merge, or discard this patch.