diff options
author | Joas Schilling <coding@schilljs.com> | 2019-02-12 18:07:59 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2019-02-12 18:07:59 +0300 |
commit | fb90a742312eb92898c56451757ebb3a5d916c88 (patch) | |
tree | fad13d0a9e8530e1a791a26d0086e1ee926d8e73 /lib/Activity | |
parent | af59422720af0d69a29221d13b1b9b32063db603 (diff) |
Make all classes strict
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Activity')
-rw-r--r-- | lib/Activity/Hooks.php | 15 | ||||
-rw-r--r-- | lib/Activity/Provider/Base.php | 26 | ||||
-rw-r--r-- | lib/Activity/Provider/Call.php | 2 | ||||
-rw-r--r-- | lib/Activity/Provider/Invitation.php | 2 |
4 files changed, 15 insertions, 30 deletions
diff --git a/lib/Activity/Hooks.php b/lib/Activity/Hooks.php index 9e7f119a7..5d3aa8dde 100644 --- a/lib/Activity/Hooks.php +++ b/lib/Activity/Hooks.php @@ -47,7 +47,11 @@ class Hooks { /** @var ITimeFactory */ protected $timeFactory; - public function __construct(IManager $activityManager, IUserSession $userSession, ChatManager $chatManager, ILogger $logger, ITimeFactory $timeFactory) { + public function __construct(IManager $activityManager, + IUserSession $userSession, + ChatManager $chatManager, + ILogger $logger, + ITimeFactory $timeFactory) { $this->activityManager = $activityManager; $this->userSession = $userSession; $this->chatManager = $chatManager; @@ -55,12 +59,7 @@ class Hooks { $this->timeFactory = $timeFactory; } - /** - * Mark the user as (in)active for a call - * - * @param Room $room - */ - public function setActive(Room $room) { + public function setActive(Room $room): void { $room->setActiveSince(new \DateTime(), !$this->userSession->isLoggedIn()); } @@ -133,7 +132,7 @@ class Hooks { * @param Room $room * @param array[] $participants */ - public function generateInvitationActivity(Room $room, array $participants) { + public function generateInvitationActivity(Room $room, array $participants): void { $actor = $this->userSession->getUser(); if (!$actor instanceof IUser) { return; diff --git a/lib/Activity/Provider/Base.php b/lib/Activity/Provider/Base.php index 264d9ef6a..dce373f4c 100644 --- a/lib/Activity/Provider/Base.php +++ b/lib/Activity/Provider/Base.php @@ -53,7 +53,11 @@ abstract class Base implements IProvider { /** @var string[] */ protected $displayNames = []; - public function __construct(IFactory $languageFactory, IURLGenerator $url, IManager $activityManager, IUserManager $userManager, Manager $manager) { + public function __construct(IFactory $languageFactory, + IURLGenerator $url, + IManager $activityManager, + IUserManager $userManager, + Manager $manager) { $this->languageFactory = $languageFactory; $this->url = $url; $this->activityManager = $activityManager; @@ -86,7 +90,7 @@ abstract class Base implements IProvider { * @param array $parameters * @throws \InvalidArgumentException */ - protected function setSubjects(IEvent $event, string $subject, array $parameters) { + protected function setSubjects(IEvent $event, string $subject, array $parameters): void { $placeholders = $replacements = []; foreach ($parameters as $placeholder => $parameter) { $placeholders[] = '{' . $placeholder . '}'; @@ -97,11 +101,6 @@ abstract class Base implements IProvider { ->setRichSubject($subject, $parameters); } - /** - * @param IL10N $l - * @param Room $room - * @return array - */ protected function getRoom(IL10N $l, Room $room): array { switch ($room->getType()) { case Room::ONE_TO_ONE_CALL: @@ -124,11 +123,6 @@ abstract class Base implements IProvider { ]; } - /** - * @param IL10N $l - * @param int $roomId - * @return array - */ protected function getFormerRoom(IL10N $l, int $roomId): array { return [ 'type' => 'call', @@ -138,10 +132,6 @@ abstract class Base implements IProvider { ]; } - /** - * @param string $uid - * @return array - */ protected function getUser(string $uid): array { if (!isset($this->displayNames[$uid])) { $this->displayNames[$uid] = $this->getDisplayName($uid); @@ -154,10 +144,6 @@ abstract class Base implements IProvider { ]; } - /** - * @param string $uid - * @return string - */ protected function getDisplayName(string $uid): string { $user = $this->userManager->get($uid); if ($user instanceof IUser) { diff --git a/lib/Activity/Provider/Call.php b/lib/Activity/Provider/Call.php index 28beed342..f70253824 100644 --- a/lib/Activity/Provider/Call.php +++ b/lib/Activity/Provider/Call.php @@ -36,7 +36,7 @@ class Call extends Base { * @since 11.0.0 */ public function parse($language, IEvent $event, IEvent $previousEvent = null): IEvent { - $event = parent::preParse($event); + $event = $this->preParse($event); if ($event->getSubject() === 'call') { $l = $this->languageFactory->get('spreed', $language); diff --git a/lib/Activity/Provider/Invitation.php b/lib/Activity/Provider/Invitation.php index 744df6c71..c01d8116f 100644 --- a/lib/Activity/Provider/Invitation.php +++ b/lib/Activity/Provider/Invitation.php @@ -36,7 +36,7 @@ class Invitation extends Base { * @since 11.0.0 */ public function parse($language, IEvent $event, IEvent $previousEvent = null): IEvent { - $event = parent::preParse($event); + $event = $this->preParse($event); if ($event->getSubject() === 'invitation') { $l = $this->languageFactory->get('spreed', $language); |