Add return types

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2019-04-16 11:44:35 +02:00 committed by Roeland Jago Douma
parent fb396fe436
commit 093c308b58
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 7 additions and 7 deletions

View File

@ -86,7 +86,7 @@ class RemoveLinkShares implements IRepairStep {
* *
* @param int $id * @param int $id
*/ */
private function deleteShare(int $id) { private function deleteShare(int $id): void {
$qb = $this->connection->getQueryBuilder(); $qb = $this->connection->getQueryBuilder();
$qb->delete('share') $qb->delete('share')
->where($qb->expr()->eq('id', $qb->createNamedParameter($id))); ->where($qb->expr()->eq('id', $qb->createNamedParameter($id)));
@ -162,7 +162,7 @@ class RemoveLinkShares implements IRepairStep {
* *
* @param array $data * @param array $data
*/ */
private function processShare(array $data) { private function processShare(array $data): void {
$id = $data['id']; $id = $data['id'];
$this->addToNotify($data['uid_owner']); $this->addToNotify($data['uid_owner']);
@ -176,7 +176,7 @@ class RemoveLinkShares implements IRepairStep {
* *
* @param string $uid * @param string $uid
*/ */
private function addToNotify(string $uid) { private function addToNotify(string $uid): void {
if (!isset($this->userToNotify[$uid])) { if (!isset($this->userToNotify[$uid])) {
$this->userToNotify[$uid] = true; $this->userToNotify[$uid] = true;
} }
@ -185,14 +185,14 @@ class RemoveLinkShares implements IRepairStep {
/** /**
* Send all notifications * Send all notifications
*/ */
private function sendNotification() { private function sendNotification(): void {
$time = $this->timeFactory->getDateTime(); $time = $this->timeFactory->getDateTime();
$notification = $this->notificationManager->createNotification(); $notification = $this->notificationManager->createNotification();
$notification->setApp('core') $notification->setApp('core')
->setDateTime($time) ->setDateTime($time)
->setObject('repair', 'exposing_links') ->setObject('repair', 'exposing_links')
->setSubject('repair_exposing_links', []); ->setSubject('repair_exposing_links');
$users = array_keys($this->userToNotify); $users = array_keys($this->userToNotify);
foreach ($users as $user) { foreach ($users as $user) {
@ -201,7 +201,7 @@ class RemoveLinkShares implements IRepairStep {
} }
} }
private function repair(IOutput $output) { private function repair(IOutput $output): void {
$total = $this->getTotal(); $total = $this->getTotal();
$output->startProgress($total); $output->startProgress($total);
@ -224,7 +224,7 @@ class RemoveLinkShares implements IRepairStep {
$this->sendNotification(); $this->sendNotification();
} }
public function run(IOutput $output) { public function run(IOutput $output): void {
if ($this->shouldRun()) { if ($this->shouldRun()) {
$output->info('Removing potentially over exposing link shares'); $output->info('Removing potentially over exposing link shares');
$this->repair($output); $this->repair($output);