diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-01-12 16:15:08 +0300 |
---|---|---|
committer | Carl Schwan <carl@carlschwan.eu> | 2022-01-12 22:33:46 +0300 |
commit | fffc19f5c3e2e1789564542f3562a7b56b587c8c (patch) | |
tree | a3d4685a5ff95f5afdcfa03e4be52ef57aa64f31 /apps/sharebymail/lib | |
parent | 7ecb65f725d7243d3f1433bb8d2cd1f981c90c07 (diff) |
Fix types warnings from psalm
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
Diffstat (limited to 'apps/sharebymail/lib')
-rw-r--r-- | apps/sharebymail/lib/ShareByMailProvider.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/apps/sharebymail/lib/ShareByMailProvider.php b/apps/sharebymail/lib/ShareByMailProvider.php index 65a7498bcd6..c1438c01125 100644 --- a/apps/sharebymail/lib/ShareByMailProvider.php +++ b/apps/sharebymail/lib/ShareByMailProvider.php @@ -334,13 +334,13 @@ class ShareByMailProvider implements IShareProvider { $share->getNote() ); - if ($this->mailer->validateMailAddress($share->getSharedWith())) { + if (!$this->mailer->validateMailAddress($share->getSharedWith())) { $this->removeShareFromTable($shareId); $e = new HintException('Failed to send share by mail. Got an invalid email address: ' . $share->getSharedWith(), $this->l->t('Failed to send share by email. Got an invalid email address')); - $this->logger->error($e->getMessage(), [ - 'message' => 'Failed to send share by mail. Got an invalid email address ' . $share->getSharedWith(), + $this->logger->error('Failed to send share by mail. Got an invalid email address ' . $share->getSharedWith(), [ 'app' => 'sharebymail', + 'exception' => $e, ]); } @@ -689,7 +689,7 @@ class ShareByMailProvider implements IShareProvider { * @param \DateTime|null $expirationTime * @return int */ - protected function addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $uidOwner, $permissions, $token, $password, $sendPasswordByTalk, $hideDownload, $label, $expirationTime, $note = '') { + protected function addShareToDB($itemSource, $itemType, $shareWith, $sharedBy, $uidOwner, $permissions, $token, $password, $sendPasswordByTalk, $hideDownload, $label, $expirationTime, $note = ''): int { $qb = $this->dbConnection->getQueryBuilder(); $qb->insert('share') ->setValue('share_type', $qb->createNamedParameter(IShare::TYPE_EMAIL)) @@ -784,7 +784,7 @@ class ShareByMailProvider implements IShareProvider { } catch (\Exception $e) { } - $this->removeShareFromTable($share->getId()); + $this->removeShareFromTable((int)$share->getId()); } /** @@ -980,9 +980,9 @@ class ShareByMailProvider implements IShareProvider { /** * remove share from table * - * @param string $shareId + * @param int $shareId */ - protected function removeShareFromTable($shareId) { + protected function removeShareFromTable(int $shareId): void { $qb = $this->dbConnection->getQueryBuilder(); $qb->delete('share') ->where($qb->expr()->eq('id', $qb->createNamedParameter($shareId))); |