Completed
Pull Request — master (#347)
by Maxence
02:26
created
lib/Model/BaseCircle.php 1 patch
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.
lib/Db/MembersRequest.php 1 patch
Doc Comments   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 	 * returns the index of a specific UserID in a Members List
233 233
 	 *
234 234
 	 * @param array $members
235
-	 * @param $userId
235
+	 * @param string $userId
236 236
 	 *
237 237
 	 * @return int
238 238
 	 */
@@ -545,6 +545,9 @@  discard block
 block discarded – undo
545 545
 	}
546 546
 
547 547
 
548
+	/**
549
+	 * @param string $groupId
550
+	 */
548 551
 	public function unlinkAllFromGroup($groupId) {
549 552
 		$qb = $this->getGroupsDeleteSql($groupId);
550 553
 		$qb->execute();
@@ -575,8 +578,6 @@  discard block
 block discarded – undo
575 578
 	/**
576 579
 	 * @param string $circleId
577 580
 	 * @param string $contactId
578
-	 * @param string $userId
579
-	 * @param int $type
580 581
 	 *
581 582
 	 * @return Member
582 583
 	 * @throws MemberDoesNotExistException
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/Service/DavService.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 	public function onDeleteCard(GenericEvent $event) {
153 153
 		$davCard = $this->generateDavCard($event, true);
154 154
 
155
-		$this->miscService->log('Deleting Card: ' . json_encode($davCard), 1);
155
+		$this->miscService->log('Deleting Card: '.json_encode($davCard), 1);
156 156
 		$this->membersRequest->removeMembersByContactId($davCard->getUniqueId(), Member::TYPE_USER);
157 157
 	}
158 158
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 	 *
207 207
 	 */
208 208
 	private function manageDavCard(DavCard $davCard) {
209
-		$this->miscService->log('Updating Card: ' . json_encode($davCard), 1);
209
+		$this->miscService->log('Updating Card: '.json_encode($davCard), 1);
210 210
 		$this->manageCircles($davCard);
211 211
 		$this->manageContact($davCard);
212 212
 	}
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 			}
321 321
 		}
322 322
 
323
-		$davCard->setUserId($davCard->getOwner() . ':' . $davCard->getContactId());
323
+		$davCard->setUserId($davCard->getOwner().':'.$davCard->getContactId());
324 324
 
325 325
 		return DavCard::TYPE_CONTACT;
326 326
 	}
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 				continue;
379 379
 			}
380 380
 
381
-			$circle = new Circle(Circle::CIRCLES_PUBLIC, $group . ' - ' . $this->uuid(5));
381
+			$circle = new Circle(Circle::CIRCLES_PUBLIC, $group.' - '.$this->uuid(5));
382 382
 			$circle->setContactAddressBook($davCard->getAddressBookId());
383 383
 			$circle->setContactGroupName($group);
384 384
 
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
 		$this->manageDeprecatedCircles();
478 478
 		$users = $this->userManager->search('');
479 479
 		foreach ($users as $user) {
480
-			$books = $this->cardDavBackend->getAddressBooksForUser('principals/users/' . $user->getUID());
480
+			$books = $this->cardDavBackend->getAddressBooksForUser('principals/users/'.$user->getUID());
481 481
 			foreach ($books as $book) {
482 482
 				$this->migrateBook($book['id']);
483 483
 			}
Please login to merge, or discard this patch.
lib/Circles/FileSharingBroadcaster.php 2 patches
Doc Comments   +8 added lines, -10 removed lines patch added patch discarded remove patch
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 	 * @param Circle $circle
339 339
 	 * @param IShare $share
340 340
 	 * @param string $address
341
-	 * @param string $token
341
+	 * @param SharesToken $token
342 342
 	 *
343 343
 	 * @return bool
344 344
 	 */
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 	 * @param $fileName
419 419
 	 * @param string $link
420 420
 	 * @param string $author
421
-	 * @param $circleName
421
+	 * @param string $circleName
422 422
 	 * @param string $email
423 423
 	 *
424 424
 	 * @throws Exception
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
 	 * @param string $circleName
456 456
 	 * @param string $email
457 457
 	 *
458
-	 * @param $password
458
+	 * @param string $password
459 459
 	 *
460 460
 	 * @throws NotFoundException
461 461
 	 * @throws Exception
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 	 * @param $subject
538 538
 	 * @param $text
539 539
 	 * @param $fileName
540
-	 * @param $link
540
+	 * @param string $link
541 541
 	 * @param string $author
542 542
 	 * @param string $circleName
543 543
 	 *
@@ -575,7 +575,6 @@  discard block
 block discarded – undo
575 575
 	 * @param Member $member
576 576
 	 * @param string $recipient
577 577
 	 * @param string $circleName
578
-	 * @param string $password
579 578
 	 */
580 579
 	public function sendMailExitingShares(
581 580
 		array $unknownShares, $author, Member $member, $recipient, $circleName
@@ -608,7 +607,7 @@  discard block
 block discarded – undo
608 607
 
609 608
 
610 609
 	/**
611
-	 * @param $author
610
+	 * @param string $author
612 611
 	 * @param string $email
613 612
 	 *
614 613
 	 * @param $password
@@ -682,7 +681,6 @@  discard block
 block discarded – undo
682 681
 	 * @param array $share
683 682
 	 * @param Member $member
684 683
 	 * @param string $password
685
-	 * @param string $token
686 684
 	 *
687 685
 	 * @return array
688 686
 	 * @throws TokenDoesNotExistException
@@ -707,7 +705,7 @@  discard block
 block discarded – undo
707 705
 
708 706
 
709 707
 	/**
710
-	 * @param $author
708
+	 * @param string $author
711 709
 	 * @param string $circleName
712 710
 	 *
713 711
 	 * @return IEMailTemplate
@@ -750,8 +748,8 @@  discard block
 block discarded – undo
750 748
 
751 749
 	/**
752 750
 	 * @param IEMailTemplate $emailTemplate
753
-	 * @param $author
754
-	 * @param $recipient
751
+	 * @param string $author
752
+	 * @param string $recipient
755 753
 	 *
756 754
 	 * @throws Exception
757 755
 	 */
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
 			$this->miscService = OC::$server->query(MiscService::class);
142 142
 		} catch (QueryException $e) {
143 143
 			OC::$server->getLogger()
144
-					   ->log(1, 'Circles: cannot init FileSharingBroadcaster - ' . $e->getMessage());
144
+					   ->log(1, 'Circles: cannot init FileSharingBroadcaster - '.$e->getMessage());
145 145
 		}
146 146
 
147 147
 		try {
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
 		if ($member->getType() === Member::TYPE_CONTACT) {
299 299
 			$recipient = MiscService::getContactData($member->getUserId());
300 300
 			// TODO: CHECK THIS CHECK THIS CHECK TINS :: Get email from Contact
301
-			$this->miscService->log('___ RECIPIENT !! ' . json_encode($recipient));
301
+			$this->miscService->log('___ RECIPIENT !! '.json_encode($recipient));
302 302
 		}
303 303
 
304 304
 		$recipient = $member->getUserId();
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 	 * @throws IllegalIDChangeException
319 319
 	 */
320 320
 	private function generateShare($data): IShare {
321
-		$this->logger->log(0, 'Regenerate shares from payload: ' . json_encode($data));
321
+		$this->logger->log(0, 'Regenerate shares from payload: '.json_encode($data));
322 322
 
323 323
 		$share = new Share($this->rootFolder, $this->userManager);
324 324
 		$share->setId($data['id']);
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
 			);
410 410
 		} catch (Exception $e) {
411 411
 			OC::$server->getLogger()
412
-					   ->log(1, 'Circles::sharedByMail - mail were not sent: ' . $e->getMessage());
412
+					   ->log(1, 'Circles::sharedByMail - mail were not sent: '.$e->getMessage());
413 413
 		}
414 414
 	}
415 415
 
@@ -427,8 +427,8 @@  discard block
 block discarded – undo
427 427
 		$message = $this->mailer->createMessage();
428 428
 
429 429
 		$this->logger->log(
430
-			0, "Sending mail to circle '" . $circleName . "': " . $email . ' file: ' . $fileName
431
-			   . ' - link: ' . $link
430
+			0, "Sending mail to circle '".$circleName."': ".$email.' file: '.$fileName
431
+			   . ' - link: '.$link
432 432
 		);
433 433
 
434 434
 		$subject = $this->l10n->t('%s shared »%s« with you.', [$author, $fileName]);
@@ -467,7 +467,7 @@  discard block
 block discarded – undo
467 467
 
468 468
 		$message = $this->mailer->createMessage();
469 469
 
470
-		$this->logger->log(0, "Sending password mail to circle '" . $circleName . "': " . $email);
470
+		$this->logger->log(0, "Sending password mail to circle '".$circleName."': ".$email);
471 471
 
472 472
 		$filename = $share->getNode()
473 473
 						  ->getName();
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 		$message->setFrom([\OCP\Util::getDefaultEmailAddress($instanceName) => $senderName]);
523 523
 		if ($initiatorEmailAddress !== null) {
524 524
 			$message->setReplyTo([$initiatorEmailAddress => $initiatorDisplayName]);
525
-			$emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan());
525
+			$emailTemplate->addFooter($instanceName.' - '.$this->defaults->getSlogan());
526 526
 		} else {
527 527
 			$emailTemplate->addFooter();
528 528
 		}
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
 		$emailTemplate->addHeader();
558 558
 		$emailTemplate->addHeading($subject, false);
559 559
 		$emailTemplate->addBodyText(
560
-			htmlspecialchars($text) . '<br>' . htmlspecialchars(
560
+			htmlspecialchars($text).'<br>'.htmlspecialchars(
561 561
 				$this->l10n->t('Click the button below to open it.')
562 562
 			), $text
563 563
 		);
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
 			$this->sendMailExistingShares($template, $author, $recipient);
603 603
 			$this->sendPasswordExistingShares($author, $recipient, $password);
604 604
 		} catch (Exception $e) {
605
-			$this->logger->log(2, 'Failed to send mail about existing share ' . $e->getMessage());
605
+			$this->logger->log(2, 'Failed to send mail about existing share '.$e->getMessage());
606 606
 		}
607 607
 	}
608 608
 
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
 		$authorName = ($authorUser instanceof IUser) ? $authorUser->getDisplayName() : $author;
627 627
 		$authorEmail = ($authorUser instanceof IUser) ? $authorUser->getEMailAddress() : null;
628 628
 
629
-		$this->logger->log(0, "Sending password mail about existing files to '" . $email . "'");
629
+		$this->logger->log(0, "Sending password mail about existing files to '".$email."'");
630 630
 
631 631
 		$plainBodyPart = $this->l10n->t(
632 632
 			"%1\$s shared multiple files with you.\nYou should have already received a separate mail with a link to access them.\n",
@@ -668,7 +668,7 @@  discard block
 block discarded – undo
668 668
 		$message->setFrom([\OCP\Util::getDefaultEmailAddress($instanceName) => $senderName]);
669 669
 		if ($authorEmail !== null) {
670 670
 			$message->setReplyTo([$authorEmail => $authorName]);
671
-			$emailTemplate->addFooter($instanceName . ' - ' . $this->defaults->getSlogan());
671
+			$emailTemplate->addFooter($instanceName.' - '.$this->defaults->getSlogan());
672 672
 		} else {
673 673
 			$emailTemplate->addFooter();
674 674
 		}
@@ -715,7 +715,7 @@  discard block
 block discarded – undo
715 715
 	 */
716 716
 	protected function generateMailExitingShares($author, $circleName) {
717 717
 		$this->logger->log(
718
-			0, "Generating mail about existing share mail from '" . $author . "' in "
718
+			0, "Generating mail about existing share mail from '".$author."' in "
719 719
 			   . $circleName
720 720
 		);
721 721
 
Please login to merge, or discard this patch.
lib/Db/TokensRequestBuilder.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -131,6 +131,9 @@
 block discarded – undo
131 131
 	}
132 132
 
133 133
 
134
+	/**
135
+	 * @param string $encoded
136
+	 */
134 137
 	protected function origPasswordDecrypt($encoded): string {
135 138
 		$key = $this->configService->getInstanceId();
136 139
 		$c = base64_decode($encoded);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@
 block discarded – undo
127 127
 		$raw = openssl_encrypt($password, $cipher, $key, $options = OPENSSL_RAW_DATA, $iv);
128 128
 		$hmac = hash_hmac('sha256', $raw, $key, $as_binary = true);
129 129
 
130
-		return base64_encode($iv . $hmac . $raw);
130
+		return base64_encode($iv.$hmac.$raw);
131 131
 	}
132 132
 
133 133
 
Please login to merge, or discard this patch.
lib/Service/ConfigService.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -406,6 +406,9 @@
 block discarded – undo
406 406
 	}
407 407
 
408 408
 
409
+	/**
410
+	 * @return string
411
+	 */
409 412
 	public function getInstanceId() {
410 413
 		return $this->config->getSystemValue('instanceid');
411 414
 	}
Please login to merge, or discard this patch.