Completed
Pull Request — master (#551)
by Maxence
02:40
created
lib/ShareByCircleProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -296,7 +296,7 @@
 block discarded – undo
296 296
 	 * @throws RequestBuilderException
297 297
 	 */
298 298
 	public function move(IShare $share, $recipient): IShare {
299
-		OC::$server->getLogger()->log(3, 'CSP > move' . $share->getId() . ' ' . $recipient);
299
+		OC::$server->getLogger()->log(3, 'CSP > move'.$share->getId().' '.$recipient);
300 300
 
301 301
 		$federatedUser = $this->federatedUserService->getLocalFederatedUser($recipient);
302 302
 		$child = $this->shareWrapperService->getChild($share, $federatedUser);
Please login to merge, or discard this patch.
lib/Command/CirclesDestroy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -125,7 +125,7 @@
 block discarded – undo
125 125
 		} catch (FederatedItemException $e) {
126 126
 			if ($input->getOption('status-code')) {
127 127
 				throw new FederatedItemException(
128
-					' [' . get_class($e) . ', ' . $e->getStatus() . ']' . "\n" . $e->getMessage()
128
+					' ['.get_class($e).', '.$e->getStatus().']'."\n".$e->getMessage()
129 129
 				);
130 130
 			}
131 131
 
Please login to merge, or discard this patch.
lib/Command/CirclesSync.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 		if (($userId = $input->getOption('user')) !== '') {
124 124
 			$federatedUser = $this->syncService->syncNextcloudUser($userId);
125 125
 			$output->writeln(
126
-				'- Nextcloud User <info>' . $userId . '</info>/<info>' . $federatedUser->getSingleId()
126
+				'- Nextcloud User <info>'.$userId.'</info>/<info>'.$federatedUser->getSingleId()
127 127
 				. '</info> synced'
128 128
 			);
129 129
 		}
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 		if (($groupId = $input->getOption('group')) !== '') {
137 137
 			$circle = $this->syncService->syncNextcloudGroup($groupId);
138 138
 			$output->writeln(
139
-				'- Nextcloud Group <info>' . $groupId . '</info>/<info>' . $circle->getSingleId()
139
+				'- Nextcloud Group <info>'.$groupId.'</info>/<info>'.$circle->getSingleId()
140 140
 				. '</info> synced'
141 141
 			);
142 142
 		}
Please login to merge, or discard this patch.
lib/Command/CirclesRemote.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -163,19 +163,19 @@  discard block
 block discarded – undo
163 163
 
164 164
 		$webfinger = $this->getWebfinger($host, Application::APP_SUBJECT);
165 165
 		if ($this->input->getOption('all')) {
166
-			$this->output->writeln('- Webfinger on <info>' . $host . '</info>');
166
+			$this->output->writeln('- Webfinger on <info>'.$host.'</info>');
167 167
 			$this->output->writeln(json_encode($webfinger, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
168 168
 			$this->output->writeln('');
169 169
 		}
170 170
 
171 171
 		if ($this->input->getOption('all')) {
172 172
 			$circleLink = $this->extractLink(Application::APP_REL, $webfinger);
173
-			$this->output->writeln('- Information about Circles app on <info>' . $host . '</info>');
173
+			$this->output->writeln('- Information about Circles app on <info>'.$host.'</info>');
174 174
 			$this->output->writeln(json_encode($circleLink, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
175 175
 			$this->output->writeln('');
176 176
 		}
177 177
 
178
-		$this->output->writeln('- Available services on <info>' . $host . '</info>');
178
+		$this->output->writeln('- Available services on <info>'.$host.'</info>');
179 179
 		foreach ($webfinger->getLinks() as $link) {
180 180
 			$app = $link->getProperty('name');
181 181
 			$ver = $link->getProperty('version');
@@ -183,14 +183,14 @@  discard block
 block discarded – undo
183 183
 				$app .= ' ';
184 184
 			}
185 185
 			if ($ver !== '') {
186
-				$ver = 'v' . $ver;
186
+				$ver = 'v'.$ver;
187 187
 			}
188 188
 
189
-			$this->output->writeln(' * ' . $link->getRel() . ' ' . $app . $ver);
189
+			$this->output->writeln(' * '.$link->getRel().' '.$app.$ver);
190 190
 		}
191 191
 		$this->output->writeln('');
192 192
 
193
-		$this->output->writeln('- Resources related to Circles on <info>' . $host . '</info>');
193
+		$this->output->writeln('- Resources related to Circles on <info>'.$host.'</info>');
194 194
 		$resource = $this->getResourceData($host, Application::APP_SUBJECT, Application::APP_REL);
195 195
 		$this->output->writeln(json_encode($resource, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
196 196
 		$this->output->writeln('');
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 
199 199
 		$tempUid = $resource->g('uid');
200 200
 		$this->output->writeln(
201
-			'- Confirming UID=' . $tempUid . ' from parsed Signatory at <info>' . $host . '</info>'
201
+			'- Confirming UID='.$tempUid.' from parsed Signatory at <info>'.$host.'</info>'
202 202
 		);
203 203
 
204 204
 		try {
@@ -206,15 +206,15 @@  discard block
 block discarded – undo
206 206
 			$this->output->writeln(' * No SignatureException: <info>Identity authed</info>');
207 207
 		} catch (SignatureException $e) {
208 208
 			$this->output->writeln(
209
-				'<error>' . $host . ' cannot auth its identity: ' . $e->getMessage() . '</error>'
209
+				'<error>'.$host.' cannot auth its identity: '.$e->getMessage().'</error>'
210 210
 			);
211 211
 
212 212
 			return;
213 213
 		}
214 214
 
215
-		$this->output->writeln(' * Found <info>' . $remoteSignatory->getUid() . '</info>');
215
+		$this->output->writeln(' * Found <info>'.$remoteSignatory->getUid().'</info>');
216 216
 		if ($remoteSignatory->getUid(true) !== $tempUid) {
217
-			$this->output->writeln('<error>looks like ' . $host . ' is faking its identity');
217
+			$this->output->writeln('<error>looks like '.$host.' is faking its identity');
218 218
 
219 219
 			return;
220 220
 		}
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 		$this->output->writeln('');
223 223
 
224 224
 		$testUrl = $resource->g('test');
225
-		$this->output->writeln('- Testing signed payload on <info>' . $testUrl . '</info>');
225
+		$this->output->writeln('- Testing signed payload on <info>'.$testUrl.'</info>');
226 226
 
227 227
 		try {
228 228
 			$localSignatory = $this->remoteStreamService->getAppSignatory();
@@ -244,18 +244,18 @@  discard block
 block discarded – undo
244 244
 		$this->output->writeln('');
245 245
 
246 246
 		$this->output->writeln(' * Clear Signature: ');
247
-		$this->output->writeln('<comment>' . $signedRequest->getClearSignature() . '</comment>');
247
+		$this->output->writeln('<comment>'.$signedRequest->getClearSignature().'</comment>');
248 248
 		$this->output->writeln('');
249 249
 
250 250
 		$this->output->writeln(' * Signed Signature (base64 encoded): ');
251 251
 		$this->output->writeln(
252
-			'<comment>' . base64_encode($signedRequest->getSignedSignature()) . '</comment>'
252
+			'<comment>'.base64_encode($signedRequest->getSignedSignature()).'</comment>'
253 253
 		);
254 254
 		$this->output->writeln('');
255 255
 
256 256
 		$result = $signedRequest->getOutgoingRequest()->getResult();
257 257
 		$code = $result->getStatusCode();
258
-		$this->output->writeln(' * Result: ' . (($code === 200) ? '<info>' . $code . '</info>' : $code));
258
+		$this->output->writeln(' * Result: '.(($code === 200) ? '<info>'.$code.'</info>' : $code));
259 259
 		$this->output->writeln(
260 260
 			json_encode(json_decode($result->getContent(), true), JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)
261 261
 		);
@@ -276,13 +276,13 @@  discard block
 block discarded – undo
276 276
 				$stored = new RemoteInstance();
277 277
 				$this->remoteStreamService->confirmValidRemote($remoteSignatory, $stored);
278 278
 				$this->output->writeln(
279
-					'<info>The remote instance ' . $host
279
+					'<info>The remote instance '.$host
280 280
 					. ' is already known with this current identity</info>'
281 281
 				);
282 282
 
283 283
 				if ($remoteSignatory->getType() !== $stored->getType()) {
284 284
 					$this->output->writeln(
285
-						'- updating type from ' . $stored->getType() . ' to '
285
+						'- updating type from '.$stored->getType().' to '
286 286
 						. $remoteSignatory->getType()
287 287
 					);
288 288
 					$this->remoteStreamService->update(
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 
293 293
 				if ($remoteSignatory->getInstance() !== $stored->getInstance()) {
294 294
 					$this->output->writeln(
295
-						'- updating host from ' . $stored->getInstance() . ' to '
295
+						'- updating host from '.$stored->getInstance().' to '
296 296
 						. $remoteSignatory->getInstance()
297 297
 					);
298 298
 					$this->remoteStreamService->update(
@@ -301,7 +301,7 @@  discard block
 block discarded – undo
301 301
 				}
302 302
 				if ($remoteSignatory->getId() !== $stored->getId()) {
303 303
 					$this->output->writeln(
304
-						'- updating href/Id from ' . $stored->getId() . ' to '
304
+						'- updating href/Id from '.$stored->getId().' to '
305 305
 						. $remoteSignatory->getId()
306 306
 					);
307 307
 					$this->remoteStreamService->update($remoteSignatory, RemoteStreamService::UPDATE_HREF);
@@ -327,10 +327,10 @@  discard block
 block discarded – undo
327 327
 		$helper = $this->getHelper('question');
328 328
 
329 329
 		$this->output->writeln(
330
-			'The remote instance <info>' . $remoteSignatory->getInstance() . '</info> looks good.'
330
+			'The remote instance <info>'.$remoteSignatory->getInstance().'</info> looks good.'
331 331
 		);
332 332
 		$question = new ConfirmationQuestion(
333
-			'Would you like to identify this remote instance as \'' . $remoteSignatory->getType()
333
+			'Would you like to identify this remote instance as \''.$remoteSignatory->getType()
334 334
 			. '\' ? (y/N) ',
335 335
 			false,
336 336
 			'/^(y|Y)/i'
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 		$helper = $this->getHelper('question');
354 354
 
355 355
 		$this->output->writeln(
356
-			'The remote instance <info>' . $remoteSignatory->getInstance()
356
+			'The remote instance <info>'.$remoteSignatory->getInstance()
357 357
 			. '</info> is known but <error>its identity has changed.</error>'
358 358
 		);
359 359
 		$this->output->writeln(
@@ -431,13 +431,13 @@  discard block
 block discarded – undo
431 431
 		if ($this->configService->isLocalInstance($instance)) {
432 432
 			return;
433 433
 		}
434
-		$this->output->write('Adding <comment>' . $instance . '</comment>: ');
434
+		$this->output->write('Adding <comment>'.$instance.'</comment>: ');
435 435
 		try {
436 436
 			$this->remoteStreamService->addRemoteInstance($instance, RemoteInstance::TYPE_GLOBAL_SCALE, true);
437 437
 			$this->output->writeln('<info>ok</info>');
438 438
 		} catch (Exception $e) {
439
-			$msg = ($e->getMessage() === '') ? '' : ' (' . $e->getMessage() . ')';
440
-			$this->output->writeln('<error>' . get_class($e) . $msg . '</error>');
439
+			$msg = ($e->getMessage() === '') ? '' : ' ('.$e->getMessage().')';
440
+			$this->output->writeln('<error>'.get_class($e).$msg.'</error>');
441 441
 		}
442 442
 	}
443 443
 
@@ -455,12 +455,12 @@  discard block
 block discarded – undo
455 455
 			try {
456 456
 				$current = $this->remoteStreamService->retrieveRemoteInstance($instance->getInstance());
457 457
 				if ($current->getUid(true) === $instance->getUid(true)) {
458
-					$currentUid = '<info>' . $current->getUid(true) . '</info>';
458
+					$currentUid = '<info>'.$current->getUid(true).'</info>';
459 459
 				} else {
460
-					$currentUid = '<error>' . $current->getUid(true) . '</error>';
460
+					$currentUid = '<error>'.$current->getUid(true).'</error>';
461 461
 				}
462 462
 			} catch (Exception $e) {
463
-				$currentUid = '<error>' . $e->getMessage() . '</error>';
463
+				$currentUid = '<error>'.$e->getMessage().'</error>';
464 464
 			}
465 465
 
466 466
 			$table->appendRow(
@@ -485,7 +485,7 @@  discard block
 block discarded – undo
485 485
 			}
486 486
 		}
487 487
 
488
-		throw new Exception('Unknown type: ' . implode(', ', RemoteInstance::$LIST_TYPE));
488
+		throw new Exception('Unknown type: '.implode(', ', RemoteInstance::$LIST_TYPE));
489 489
 	}
490 490
 
491 491
 }
Please login to merge, or discard this patch.
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/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/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/Command/CirclesList.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@
 block discarded – undo
148 148
 	 * @throws UnknownRemoteException
149 149
 	 * @throws UserTypeNotFoundException
150 150
 	 * @throws FederatedItemException
151
-		 * @throws MemberNotFoundException
151
+	 * @throws MemberNotFoundException
152 152
 	 * @throws SingleCircleNotFoundException
153 153
 	 */
154 154
 	protected function execute(InputInterface $input, OutputInterface $output): int {
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.