Completed
Push — master ( 8fe337...04660b )
by Maxence
34s queued 11s
created
lib/Service/ShareService.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -33,7 +33,6 @@
 block discarded – undo
33 33
 
34 34
 
35 35
 use OCA\Circles\Model\Circle;
36
-use OCA\Circles\Model\Federated\FederatedEvent;
37 36
 
38 37
 /**
39 38
  * Class ShareService
Please login to merge, or discard this patch.
lib/ShareByCircleProviderDeprecated.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -438,8 +438,8 @@
 block discarded – undo
438 438
 
439 439
 	/**
440 440
 	 * @param string $userId
441
-	 * @param $shareType
442
-	 * @param Node $node
441
+	 * @param integer $shareType
442
+	 * @param Node|null $node
443 443
 	 * @param int $limit
444 444
 	 * @param int $offset
445 445
 	 *
Please login to merge, or discard this patch.
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -494,7 +494,6 @@
 block discarded – undo
494 494
 
495 495
 	/**
496 496
 	 * Get shares for a given path
497
-
498 497
 	 * @param Node $path
499 498
 	 *
500 499
 	 * @return IShare[]|null
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -331,19 +331,19 @@  discard block
 block discarded – undo
331 331
 	 */
332 332
 	private function createShare($share) {
333 333
 		$this->miscService->log(
334
-			'Creating share (1/4) - type: ' . $share->getShareType() . ' - token: '
335
-			. $share->getToken() . ' - type: ' . $share->getShareType() . ' - with: '
336
-			. $share->getSharedWith() . ' - permissions: ' . $share->getPermissions(), 0
334
+			'Creating share (1/4) - type: '.$share->getShareType().' - token: '
335
+			. $share->getToken().' - type: '.$share->getShareType().' - with: '
336
+			. $share->getSharedWith().' - permissions: '.$share->getPermissions(), 0
337 337
 		);
338 338
 
339 339
 		$qb = $this->getBaseInsertSql($share);
340
-		$this->miscService->log('Share creation (2/4) : ' . json_encode($qb->getSQL()), 0);
340
+		$this->miscService->log('Share creation (2/4) : '.json_encode($qb->getSQL()), 0);
341 341
 
342 342
 		$result = $qb->execute();
343
-		$this->miscService->log('Share creation result (3/4) : ' . json_encode($result), 0);
343
+		$this->miscService->log('Share creation result (3/4) : '.json_encode($result), 0);
344 344
 
345 345
 		$id = $qb->getLastInsertId();
346
-		$this->miscService->log('Share created ID (4/4) : ' . $id, 0);
346
+		$this->miscService->log('Share created ID (4/4) : '.$id, 0);
347 347
 
348 348
 		try {
349 349
 			$share->setId($id);
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
 		\OC::$server->getLogger()->log(3, 'deprecated>getShareByToken');
591 591
 		$qb = $this->dbConnection->getQueryBuilder();
592 592
 
593
-		$this->miscService->log("Opening share by token '#" . $token . "'", 0);
593
+		$this->miscService->log("Opening share by token '#".$token."'", 0);
594 594
 
595 595
 		$cursor = $qb->select('*')
596 596
 					 ->from('share')
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
 			try {
615 615
 				$data = $this->getShareByPersonalToken($token);
616 616
 			} catch (Exception $e) {
617
-				$this->miscService->log("Share '#" . $token . "' not found.", 0);
617
+				$this->miscService->log("Share '#".$token."' not found.", 0);
618 618
 				throw new ShareNotFound('Share not found', $this->l10n->t('Could not find share'));
619 619
 			}
620 620
 		}
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
 			$share = $this->createShareObject($data);
624 624
 		} catch (InvalidShare $e) {
625 625
 			$this->miscService->log(
626
-				"Share Object '#" . $token . "' not created. " . json_encode($data), 0
626
+				"Share Object '#".$token."' not created. ".json_encode($data), 0
627 627
 			);
628 628
 			throw new ShareNotFound('Share not found', $this->l10n->t('Could not find share'));
629 629
 		}
Please login to merge, or discard this patch.
tests/unit/lib/Api/CirclesTest.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -861,7 +861,7 @@
 block discarded – undo
861 861
 	/**
862 862
 	 * function to generate admin/moderator/member and assigning them their level.
863 863
 	 *
864
-	 * @param $circleId
864
+	 * @param integer $circleId
865 865
 	 * @param bool $isClosed
866 866
 	 *
867 867
 	 * @throws QueryException
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -331,7 +331,7 @@  discard block
 block discarded – undo
331 331
 			} catch (Exception $e) {
332 332
 				$this->assertSame(
333 333
 					true, false,
334
-					'should have returned a MemberIsNotModeratorException - ' . $e->getMessage()
334
+					'should have returned a MemberIsNotModeratorException - '.$e->getMessage()
335 335
 				);
336 336
 			}
337 337
 
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 			} catch (Exception $e) {
346 346
 				$this->assertSame(
347 347
 					true, false,
348
-					'should have returned a MemberIsNotModeratorException - ' . $e->getMessage()
348
+					'should have returned a MemberIsNotModeratorException - '.$e->getMessage()
349 349
 				);
350 350
 			}
351 351
 
Please login to merge, or discard this patch.
tests/bootstrap.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@
 block discarded – undo
7 7
 	define('PHPUNIT_RUN', 1);
8 8
 }
9 9
 
10
-require_once __DIR__ . '/../../../lib/base.php';
10
+require_once __DIR__.'/../../../lib/base.php';
11 11
 
12 12
 // Fix for "Autoload path not allowed: .../tests/lib/testcase.php"
13
-\OC::$loader->addValidRoot(OC::$SERVERROOT . '/tests');
13
+\OC::$loader->addValidRoot(OC::$SERVERROOT.'/tests');
14 14
 
15 15
 \OC_App::loadApp(Application::APP_ID);
16 16
 
Please login to merge, or discard this patch.
templates/files/list.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,14 +18,14 @@
 block discarded – undo
18 18
 		<tr>
19 19
 			<th id='headerName' class="hidden column-name">
20 20
 				<div id="headerName-container">
21
-					<a class="name sort columntitle" data-sort="name"><span><?php p($l->t( 'Name' )); ?></span><span class="sort-indicator"></span></a>
21
+					<a class="name sort columntitle" data-sort="name"><span><?php p($l->t('Name')); ?></span><span class="sort-indicator"></span></a>
22 22
 				</div>
23 23
 			</th>
24 24
 			<th id="headerSize" class="hidden column-size">
25 25
 				<a class="size sort columntitle" data-sort="size"><span><?php p($l->t('Size')); ?></span><span class="sort-indicator"></span></a>
26 26
 			</th>
27 27
 			<th id="headerDate" class="hidden column-mtime">
28
-				<a id="modified" class="columntitle" data-sort="mtime"><span><?php p($l->t( 'Modified' )); ?></span><span class="sort-indicator"></span></a>
28
+				<a id="modified" class="columntitle" data-sort="mtime"><span><?php p($l->t('Modified')); ?></span><span class="sort-indicator"></span></a>
29 29
 			</th>
30 30
 		</tr>
31 31
 	</thead>
Please login to merge, or discard this patch.
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.