From a973667ed0a5c09f7c927ec8acb21cb2697aac51 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Mon, 4 Jul 2022 09:53:16 +0200 Subject: [PATCH] Minor: Code syntax - refs BT#19984 --- main/inc/lib/message.lib.php | 21 +++++++++++++-------- main/inc/lib/social.lib.php | 3 ++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/main/inc/lib/message.lib.php b/main/inc/lib/message.lib.php index f481605ddc..15b5590184 100755 --- a/main/inc/lib/message.lib.php +++ b/main/inc/lib/message.lib.php @@ -921,13 +921,15 @@ class MessageManager } /** - * Delete (or just flag) a message (and its attachment) from the table and disk + * Delete (or just flag) a message (and its attachment) from the table and disk. + * * @param int The owner (receiver) of the message * @param int The internal ID of the message * @param bool Whether to really delete the message (true) or just mark it deleted (default/false) * - * @return bool False on error, true otherwise * @throws Exception if file cannot be deleted in delete_message_attachment_file() + * + * @return bool False on error, true otherwise */ public static function delete_message_by_user_receiver(int $user_receiver_id, int $id, bool $realDelete = false) { @@ -967,16 +969,18 @@ class MessageManager } /** - * Set status deleted or delete the message completely + * Set status deleted or delete the message completely. * * @author Isaac FLores Paz * @author Yannick Warnier - Added realDelete option + * * @param int The user's sender ID * @param int The message's ID * @param bool whether to really delete the message (true) or just mark it deleted (default/false) * - * @return bool * @throws Exception if file cannot be deleted in delete_message_attachment_file() + * + * @return bool */ public static function delete_message_by_user_sender(int $user_sender_id, int $id, bool $realDelete = false) { @@ -1103,18 +1107,19 @@ class MessageManager * * @param int message id * @param int message user id (receiver user id or sender user id) - * @param int group id (optional) + * @param null|int group id (optional) * @param bool whether to really delete the file (true) or just mark it deleted (default/false) - * @return void + * * @throws Exception if file cannot be deleted + * + * @return void */ public static function delete_message_attachment_file( int $message_id, int $message_uid, ?int $group_id = 0, bool $realDelete = false - ): void - { + ): void { $table_message_attach = Database::get_main_table(TABLE_MESSAGE_ATTACHMENT); $sql = "SELECT * FROM $table_message_attach diff --git a/main/inc/lib/social.lib.php b/main/inc/lib/social.lib.php index 1c628ca180..803f4f558f 100755 --- a/main/inc/lib/social.lib.php +++ b/main/inc/lib/social.lib.php @@ -2123,8 +2123,9 @@ class SocialManager extends UserManager * * @param int $id id message to delete * - * @return bool status query * @throws Exception if file cannot be deleted in delete_message_attachment_file() + * + * @return bool status query */ public static function deleteMessage($id) {