diff options
author | Joas Schilling <coding@schilljs.com> | 2021-08-26 15:14:05 +0300 |
---|---|---|
committer | Gary Kim <gary@garykim.dev> | 2021-09-20 21:30:30 +0300 |
commit | a3cd8312a28942cda4260892f442834d41d66e54 (patch) | |
tree | 2e50d5b632898d5ea12086b214f9df6a0367bc4f /lib | |
parent | 9f3695d748d163f2de5ea5ef394b8d7a0caf7a6a (diff) |
Strict
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/BackgroundJob/RetryJob.php | 6 | ||||
-rw-r--r-- | lib/Federation/Notifications.php | 16 |
2 files changed, 8 insertions, 14 deletions
diff --git a/lib/BackgroundJob/RetryJob.php b/lib/BackgroundJob/RetryJob.php index ee659023b..0fe59c930 100644 --- a/lib/BackgroundJob/RetryJob.php +++ b/lib/BackgroundJob/RetryJob.php @@ -67,7 +67,7 @@ class RetryJob extends Job { * @param IJobList $jobList * @param ILogger|null $logger */ - public function execute(IJobList $jobList, ILogger $logger = null) { + public function execute(IJobList $jobList, ?ILogger $logger = null) { if (((int)$this->argument['try']) > $this->maxTry) { $jobList->remove($this, $this->argument); return; @@ -78,7 +78,7 @@ class RetryJob extends Job { } } - protected function run($argument) { + protected function run($argument): void { $remote = $argument['remote']; $data = json_decode($argument['data'], true); $try = (int)$argument['try'] + 1; @@ -92,7 +92,7 @@ class RetryJob extends Job { * @param array $argument * @return bool */ - protected function shouldRun(array $argument) { + protected function shouldRun(array $argument): bool { $lastRun = (int)$argument['lastRun']; return (($this->time->getTime() - $lastRun) > $this->interval); } diff --git a/lib/Federation/Notifications.php b/lib/Federation/Notifications.php index f88d902ff..9df734582 100644 --- a/lib/Federation/Notifications.php +++ b/lib/Federation/Notifications.php @@ -29,7 +29,6 @@ use OCA\FederatedFileSharing\AddressHandler; use OCA\Talk\AppInfo\Application; use OCA\Talk\BackgroundJob\RetryJob; use OCA\Talk\Exceptions\RoomHasNoModeratorException; -use OCA\Talk\MatterbridgeManager; use OCA\Talk\Model\Attendee; use OCA\Talk\Model\AttendeeMapper; use OCA\Talk\Participant; @@ -64,9 +63,6 @@ class Notifications { /** @var AttendeeMapper */ private $attendeeMapper; - /** @var MatterbridgeManager */ - private $matterbridgeManager; - public function __construct( ICloudFederationFactory $cloudFederationFactory, AddressHandler $addressHandler, @@ -74,8 +70,7 @@ class Notifications { ICloudFederationProviderManager $federationProviderManager, IJobList $jobList, IUserManager $userManager, - AttendeeMapper $attendeeMapper, - MatterbridgeManager $matterbridgeManager + AttendeeMapper $attendeeMapper ) { $this->cloudFederationFactory = $cloudFederationFactory; $this->addressHandler = $addressHandler; @@ -84,7 +79,6 @@ class Notifications { $this->jobList = $jobList; $this->userManager = $userManager; $this->attendeeMapper = $attendeeMapper; - $this->matterbridgeManager = $matterbridgeManager; } /** @@ -217,7 +211,7 @@ class Notifications { return true; } - public function sendRemoteUnShare(string $remote, string $id, string $token) { + public function sendRemoteUnShare(string $remote, string $id, string $token): void { $remote = $this->prepareRemoteUrl($remote); $notification = $this->cloudFederationFactory->getCloudFederationNotification(); @@ -234,7 +228,7 @@ class Notifications { $this->sendUpdateToRemote($remote, $notification); } - public function sendUpdateDataToRemote(string $remote, array $data = [], int $try = 0) { + public function sendUpdateDataToRemote(string $remote, array $data = [], int $try = 0): void { $notification = $this->cloudFederationFactory->getCloudFederationNotification(); $notification->setMessage( $data['notificationType'], @@ -245,7 +239,7 @@ class Notifications { $this->sendUpdateToRemote($remote, $notification, $try); } - public function sendUpdateToRemote(string $remote, ICloudFederationNotification $notification, int $try = 0) { + public function sendUpdateToRemote(string $remote, ICloudFederationNotification $notification, int $try = 0): void { $response = $this->federationProviderManager->sendNotification($remote, $notification); if (!is_array($response)) { $this->jobList->add(RetryJob::class, @@ -260,7 +254,7 @@ class Notifications { private function prepareRemoteUrl(string $remote): string { if ($this->addressHandler->urlContainProtocol($remote)) { - return "https://" . $remote; + return 'https://' . $remote; } return $remote; } |