@@ -334,13 +334,13 @@ protected function createMailShare(IShare $share) {
334334 $ share ->getNote ()
335335 );
336336
337- if ($ this ->mailer ->validateMailAddress ($ share ->getSharedWith ())) {
337+ if (! $ this ->mailer ->validateMailAddress ($ share ->getSharedWith ())) {
338338 $ this ->removeShareFromTable ($ shareId );
339339 $ e = new HintException ('Failed to send share by mail. Got an invalid email address: ' . $ share ->getSharedWith (),
340340 $ this ->l ->t ('Failed to send share by email. Got an invalid email address ' ));
341- $ this ->logger ->error ($ e ->getMessage (), [
342- 'message ' => 'Failed to send share by mail. Got an invalid email address ' . $ share ->getSharedWith (),
341+ $ this ->logger ->error ('Failed to send share by mail. Got an invalid email address ' . $ share ->getSharedWith (), [
343342 'app ' => 'sharebymail ' ,
343+ 'exception ' => $ e ,
344344 ]);
345345 }
346346
@@ -689,7 +689,7 @@ public function getChildren(IShare $parent) {
689689 * @param \DateTime|null $expirationTime
690690 * @return int
691691 */
692- protected function addShareToDB ($ itemSource , $ itemType , $ shareWith , $ sharedBy , $ uidOwner , $ permissions , $ token , $ password , $ sendPasswordByTalk , $ hideDownload , $ label , $ expirationTime , $ note = '' ) {
692+ protected function addShareToDB ($ itemSource , $ itemType , $ shareWith , $ sharedBy , $ uidOwner , $ permissions , $ token , $ password , $ sendPasswordByTalk , $ hideDownload , $ label , $ expirationTime , $ note = '' ): int {
693693 $ qb = $ this ->dbConnection ->getQueryBuilder ();
694694 $ qb ->insert ('share ' )
695695 ->setValue ('share_type ' , $ qb ->createNamedParameter (IShare::TYPE_EMAIL ))
@@ -784,7 +784,7 @@ public function delete(IShare $share) {
784784 } catch (\Exception $ e ) {
785785 }
786786
787- $ this ->removeShareFromTable ($ share ->getId ());
787+ $ this ->removeShareFromTable (( int ) $ share ->getId ());
788788 }
789789
790790 /**
@@ -980,9 +980,9 @@ public function getShareByToken($token) {
980980 /**
981981 * remove share from table
982982 *
983- * @param string $shareId
983+ * @param int $shareId
984984 */
985- protected function removeShareFromTable ($ shareId ) {
985+ protected function removeShareFromTable (int $ shareId ): void {
986986 $ qb = $ this ->dbConnection ->getQueryBuilder ();
987987 $ qb ->delete ('share ' )
988988 ->where ($ qb ->expr ()->eq ('id ' , $ qb ->createNamedParameter ($ shareId )));
0 commit comments