Completed
Pull Request — master (#384)
by Tortue
02:27
created
lib/Service/MembersService.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -344,7 +344,7 @@
 block discarded – undo
344 344
 			);
345 345
 		}
346 346
 
347
-		$tmpContact = $this->userId . ':' . $ident;
347
+		$tmpContact = $this->userId.':'.$ident;
348 348
 		$result = MiscService::getContactData($tmpContact);
349 349
 		if (empty($result)) {
350 350
 			throw new NoUserException($this->l10n->t("This contact is not available"));
Please login to merge, or discard this patch.
Doc Comments   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 	 *
144 144
 	 * @param bool $force
145 145
 	 *
146
-	 * @return array
146
+	 * @return Member[]
147 147
 	 * @throws Exception
148 148
 	 */
149 149
 	public function addMember($circleUniqueId, $ident, $type, bool $force = false) {
@@ -301,8 +301,8 @@  discard block
 block discarded – undo
301 301
 	/**
302 302
 	 * Verify if a local account is valid.
303 303
 	 *
304
-	 * @param $ident
305
-	 * @param $type
304
+	 * @param string $ident
305
+	 * @param integer $type
306 306
 	 *
307 307
 	 * @throws NoUserException
308 308
 	 */
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 	 * Verify if a mail have a valid format.
324 324
 	 *
325 325
 	 * @param $ident
326
-	 * @param $type
326
+	 * @param integer $type
327 327
 	 *
328 328
 	 * @throws EmailAccountInvalidFormatException
329 329
 	 */
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
 	 * Verify if a contact exist in current user address books.
352 352
 	 *
353 353
 	 * @param $ident
354
-	 * @param $type
354
+	 * @param integer $type
355 355
 	 *
356 356
 	 * @throws NoUserException
357 357
 	 * @throws EmailAccountInvalidFormatException
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
 	 * @param int $level
483 483
 	 * @param bool $force
484 484
 	 *
485
-	 * @return array
485
+	 * @return Member[]
486 486
 	 * @throws CircleDoesNotExistException
487 487
 	 * @throws CircleTypeNotValidException
488 488
 	 * @throws ConfigNoCircleAvailableException
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
 	/**
524 524
 	 * @param Circle $circle
525 525
 	 * @param Member $member
526
-	 * @param $level
526
+	 * @param integer $level
527 527
 	 * @param bool $force
528 528
 	 *
529 529
 	 * @throws Exception
@@ -598,10 +598,10 @@  discard block
 block discarded – undo
598 598
 	/**
599 599
 	 * @param string $circleUniqueId
600 600
 	 * @param string $name
601
-	 * @param $type
601
+	 * @param integer $type
602 602
 	 * @param bool $force
603 603
 	 *
604
-	 * @return array
604
+	 * @return Member[]
605 605
 	 * @throws CircleDoesNotExistException
606 606
 	 * @throws ConfigNoCircleAvailableException
607 607
 	 * @throws MemberDoesNotExistException
Please login to merge, or discard this patch.
lib/Model/BaseCircle.php 2 patches
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
 	}
401 401
 
402 402
 	/**
403
-	 * @return string
403
+	 * @return integer
404 404
 	 */
405 405
 	public function getType() {
406 406
 		return $this->type;
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 	}
426 426
 
427 427
 	/**
428
-	 * @param array $members
428
+	 * @param Member[] $members
429 429
 	 *
430 430
 	 * @return BaseCircle
431 431
 	 */
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
 	}
437 437
 
438 438
 	/**
439
-	 * @return array
439
+	 * @return Member[]
440 440
 	 */
441 441
 	public function getMembers() {
442 442
 		return $this->members;
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 	}
455 455
 
456 456
 	/**
457
-	 * @return array
457
+	 * @return Member[]
458 458
 	 */
459 459
 	public function getGroups() {
460 460
 		return $this->groups;
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
 	}
473 473
 
474 474
 	/**
475
-	 * @return array
475
+	 * @return FederatedLink[]
476 476
 	 */
477 477
 	public function getLinks() {
478 478
 		return $this->links;
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
 //	}
509 509
 
510 510
 	/**
511
-	 * @param integer|string $type
511
+	 * @param string $type
512 512
 	 *
513 513
 	 * @return integer
514 514
 	 */
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
 	 * @return BaseCircle
316 316
 	 */
317 317
 	public function setGroupId($groupId) {
318
-		$this->groupId = (string) $groupId;
318
+		$this->groupId = (string)$groupId;
319 319
 
320 320
 		return $this;
321 321
 	}
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
 	 * @return string
325 325
 	 */
326 326
 	public function getGroupId() {
327
-		return (string) $this->groupId;
327
+		return (string)$this->groupId;
328 328
 	}
329 329
 
330 330
 	/**
Please login to merge, or discard this patch.
appinfo/app.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
 use OCA\Circles\AppInfo\Application;
31 31
 
32 32
 
33
-require_once __DIR__ . '/autoload.php';
33
+require_once __DIR__.'/autoload.php';
34 34
 
35 35
 
36 36
 $app = \OC::$server->query(Application::class);
Please login to merge, or discard this patch.
lib/Model/DavCard.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
146 146
 	 * @return string
147 147
 	 */
148 148
 	public function getUniqueId(): string {
149
-		return $this->getAddressBookId() . '/' . $this->getCardUri();
149
+		return $this->getAddressBookId().'/'.$this->getCardUri();
150 150
 	}
151 151
 
152 152
 
Please login to merge, or discard this patch.
lib/Circles/FileSharingBroadcaster.php 2 patches
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 			$this->miscService = OC::$server->query(MiscService::class);
146 146
 		} catch (QueryException $e) {
147 147
 			OC::$server->getLogger()
148
-					   ->log(1, 'Circles: cannot init FileSharingBroadcaster - ' . $e->getMessage());
148
+					   ->log(1, 'Circles: cannot init FileSharingBroadcaster - '.$e->getMessage());
149 149
 		}
150 150
 
151 151
 		try {
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
 	 * @throws IllegalIDChangeException
323 323
 	 */
324 324
 	private function generateShare($data): IShare {
325
-		$this->logger->log(0, 'Regenerate shares from payload: ' . json_encode($data));
325
+		$this->logger->log(0, 'Regenerate shares from payload: '.json_encode($data));
326 326
 
327 327
 		$share = new Share($this->rootFolder, $this->userManager);
328 328
 		$share->setId($data['id']);
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
 			);
414 414
 		} catch (Exception $e) {
415 415
 			OC::$server->getLogger()
416
-					   ->log(1, 'Circles::sharedByMail - mail were not sent: ' . $e->getMessage());
416
+					   ->log(1, 'Circles::sharedByMail - mail were not sent: '.$e->getMessage());
417 417
 		}
418 418
 	}
419 419
 
@@ -431,8 +431,8 @@  discard block
 block discarded – undo
431 431
 		$message = $this->mailer->createMessage();
432 432
 
433 433
 		$this->logger->log(
434
-			0, "Sending mail to circle '" . $circleName . "': " . $email . ' file: ' . $fileName
435
-			   . ' - link: ' . $link
434
+			0, "Sending mail to circle '".$circleName."': ".$email.' file: '.$fileName
435
+			   . ' - link: '.$link
436 436
 		);
437 437
 
438 438
 		$subject = $this->l10n->t('%s shared »%s« with you.', [$author, $fileName]);
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
 
472 472
 		$message = $this->mailer->createMessage();
473 473
 
474
-		$this->logger->log(0, "Sending password mail to circle '" . $circleName . "': " . $email);
474
+		$this->logger->log(0, "Sending password mail to circle '".$circleName."': ".$email);
475 475
 
476 476
 		$filename = $share->getNode()
477 477
 						  ->getName();
@@ -526,7 +526,7 @@  discard block
 block discarded – undo
526 526
 		$message->setFrom([\OCP\Util::getDefaultEmailAddress($instanceName) => $senderName]);
527 527
 		if ($initiatorEmailAddress !== null) {
528 528
 			$message->setReplyTo([$initiatorEmailAddress => $initiatorDisplayName]);
529
-			$emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan());
529
+			$emailTemplate->addFooter($instanceName.' - '.$this->defaults->getSlogan());
530 530
 		} else {
531 531
 			$emailTemplate->addFooter();
532 532
 		}
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
 		$emailTemplate->addHeader();
562 562
 		$emailTemplate->addHeading($subject, false);
563 563
 		$emailTemplate->addBodyText(
564
-			htmlspecialchars($text) . '<br>' . htmlspecialchars(
564
+			htmlspecialchars($text).'<br>'.htmlspecialchars(
565 565
 				$this->l10n->t('Click the button below to open it.')
566 566
 			), $text
567 567
 		);
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 			$this->sendMailExistingShares($template, $author, $recipient);
607 607
 			$this->sendPasswordExistingShares($author, $recipient, $password);
608 608
 		} catch (Exception $e) {
609
-			$this->logger->log(2, 'Failed to send mail about existing share ' . $e->getMessage());
609
+			$this->logger->log(2, 'Failed to send mail about existing share '.$e->getMessage());
610 610
 		}
611 611
 	}
612 612
 
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
 		$authorName = ($authorUser instanceof IUser) ? $authorUser->getDisplayName() : $author;
631 631
 		$authorEmail = ($authorUser instanceof IUser) ? $authorUser->getEMailAddress() : null;
632 632
 
633
-		$this->logger->log(0, "Sending password mail about existing files to '" . $email . "'");
633
+		$this->logger->log(0, "Sending password mail about existing files to '".$email."'");
634 634
 
635 635
 		$plainBodyPart = $this->l10n->t(
636 636
 			"%1\$s shared multiple files with you.\nYou should have already received a separate mail with a link to access them.\n",
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 		$message->setFrom([\OCP\Util::getDefaultEmailAddress($instanceName) => $senderName]);
673 673
 		if ($authorEmail !== null) {
674 674
 			$message->setReplyTo([$authorEmail => $authorName]);
675
-			$emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan());
675
+			$emailTemplate->addFooter($instanceName.' - '.$this->defaults->getSlogan());
676 676
 		} else {
677 677
 			$emailTemplate->addFooter();
678 678
 		}
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
 	 */
720 720
 	protected function generateMailExitingShares($author, $circleName) {
721 721
 		$this->logger->log(
722
-			0, "Generating mail about existing share mail from '" . $author . "' in "
722
+			0, "Generating mail about existing share mail from '".$author."' in "
723 723
 			   . $circleName
724 724
 		);
725 725
 
Please login to merge, or discard this patch.
Doc Comments   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 	 * @param Circle $circle
345 345
 	 * @param IShare $share
346 346
 	 * @param string $address
347
-	 * @param string $token
347
+	 * @param SharesToken $token
348 348
 	 *
349 349
 	 * @return bool
350 350
 	 */
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
 	 * @param $fileName
428 428
 	 * @param string $link
429 429
 	 * @param string $author
430
-	 * @param $circleName
430
+	 * @param string $circleName
431 431
 	 * @param string $email
432 432
 	 *
433 433
 	 * @throws Exception
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
 	 * @param string $circleName
465 465
 	 * @param string $email
466 466
 	 *
467
-	 * @param $password
467
+	 * @param string $password
468 468
 	 *
469 469
 	 * @throws NotFoundException
470 470
 	 * @throws Exception
@@ -546,7 +546,7 @@  discard block
 block discarded – undo
546 546
 	 * @param $subject
547 547
 	 * @param $text
548 548
 	 * @param $fileName
549
-	 * @param $link
549
+	 * @param string $link
550 550
 	 * @param string $author
551 551
 	 * @param string $circleName
552 552
 	 *
@@ -618,10 +618,10 @@  discard block
 block discarded – undo
618 618
 
619 619
 
620 620
 	/**
621
-	 * @param $author
621
+	 * @param string $author
622 622
 	 * @param string $email
623 623
 	 *
624
-	 * @param $password
624
+	 * @param string $password
625 625
 	 *
626 626
 	 * @throws Exception
627 627
 	 */
@@ -715,7 +715,7 @@  discard block
 block discarded – undo
715 715
 
716 716
 
717 717
 	/**
718
-	 * @param $author
718
+	 * @param string $author
719 719
 	 * @param string $circleName
720 720
 	 *
721 721
 	 * @return IEMailTemplate
@@ -758,8 +758,8 @@  discard block
 block discarded – undo
758 758
 
759 759
 	/**
760 760
 	 * @param IEMailTemplate $emailTemplate
761
-	 * @param $author
762
-	 * @param $recipient
761
+	 * @param string $author
762
+	 * @param string $recipient
763 763
 	 *
764 764
 	 * @throws Exception
765 765
 	 */
Please login to merge, or discard this patch.
lib/Service/DavService.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 	public function onDeleteCard(GenericEvent $event) {
159 159
 		$davCard = $this->generateDavCard($event, true);
160 160
 
161
-		$this->miscService->log('Deleting Card: ' . json_encode($davCard), 1);
161
+		$this->miscService->log('Deleting Card: '.json_encode($davCard), 1);
162 162
 		$this->membersRequest->removeMembersByContactId($davCard->getUniqueId(), Member::TYPE_USER);
163 163
 		$this->manageDeprecatedCircles($davCard->getAddressBookId());
164 164
 		$this->manageDeprecatedMembers($davCard);
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
 	 *
215 215
 	 */
216 216
 	private function manageDavCard(DavCard $davCard) {
217
-		$this->miscService->log('Updating Card: ' . json_encode($davCard), 1);
217
+		$this->miscService->log('Updating Card: '.json_encode($davCard), 1);
218 218
 		$this->manageCircles($davCard);
219 219
 		$this->manageContact($davCard);
220 220
 	}
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 			}
333 333
 		}
334 334
 
335
-		$davCard->setUserId($davCard->getOwner() . ':' . $davCard->getContactId());
335
+		$davCard->setUserId($davCard->getOwner().':'.$davCard->getContactId());
336 336
 
337 337
 		return DavCard::TYPE_CONTACT;
338 338
 	}
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
 			}
392 392
 
393 393
 			$user = $this->userManager->get($davCard->getOwner());
394
-			$circle = new Circle($this->configService->contactsBackendType(), $group . ' - ' . $user->getDisplayName());
394
+			$circle = new Circle($this->configService->contactsBackendType(), $group.' - '.$user->getDisplayName());
395 395
 			$circle->setContactAddressBook($davCard->getAddressBookId());
396 396
 			$circle->setContactGroupName($group);
397 397
 
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
 		$this->manageDeprecatedCircles();
491 491
 		$users = $this->userManager->search('');
492 492
 		foreach ($users as $user) {
493
-			$books = $this->cardDavBackend->getAddressBooksForUser('principals/users/' . $user->getUID());
493
+			$books = $this->cardDavBackend->getAddressBooksForUser('principals/users/'.$user->getUID());
494 494
 			foreach ($books as $book) {
495 495
 				$this->migrateBook($book['id']);
496 496
 			}
Please login to merge, or discard this patch.
lib/Migration/Version0017Date20200202112903.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -273,7 +273,7 @@
 block discarded – undo
273 273
 			}
274 274
 
275 275
 			$ak = array_keys($default);
276
-			foreach($ak as $k) {
276
+			foreach ($ak as $k) {
277 277
 //				if (!array_key_exists($k, $row)) {
278 278
 					$copy->setValue($k, $copy->createNamedParameter($default[$k]));
279 279
 //				}
Please login to merge, or discard this patch.
lib/Controller/SharesController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
 	 */
132 132
 	public function create($circleUniqueId, $source, $type, $payload) {
133 133
 
134
-		$this->miscService->log('Creating circle share: ' . $circleUniqueId, 0);
134
+		$this->miscService->log('Creating circle share: '.$circleUniqueId, 0);
135 135
 
136 136
 		try {
137 137
 			$share = new SharingFrame($source, $type);
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
 
140 140
 			$this->sharingFrameService->createFrame($circleUniqueId, $share);
141 141
 		} catch (\Exception $e) {
142
-			$this->miscService->log('Failed to create circle - ' . $e->getMessage(), 3);
142
+			$this->miscService->log('Failed to create circle - '.$e->getMessage(), 3);
143 143
 			return $this->fail(
144 144
 				[
145 145
 					'circle_id' => $circleUniqueId,
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
 			);
152 152
 		}
153 153
 
154
-		$this->miscService->log('Created circle: share ' . $circleUniqueId, 0);
154
+		$this->miscService->log('Created circle: share '.$circleUniqueId, 0);
155 155
 
156 156
 		return $this->success(
157 157
 			[
Please login to merge, or discard this patch.
lib/Command/CirclesDetails.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@
 block discarded – undo
86 86
 
87 87
 		$circle = $this->circlesRequest->forceGetCircle($circleId);
88 88
 
89
-		echo json_encode($circle, JSON_PRETTY_PRINT) . "\n";
89
+		echo json_encode($circle, JSON_PRETTY_PRINT)."\n";
90 90
 
91 91
 		return 0;
92 92
 	}
Please login to merge, or discard this patch.