1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-16 13:44:12 +02:00

[ticket/17135] Move notify method constants to interface class

PHPBB-17135
This commit is contained in:
rxu
2025-01-06 20:01:52 +07:00
parent 28d5534d06
commit 0d8c0c4228
21 changed files with 77 additions and 50 deletions

View File

@@ -13,6 +13,8 @@
namespace phpbb\message;
use phpbb\messenger\method\messenger_interface;
/**
* Class message
* Holds all information for an email and sends it in the end
@@ -46,7 +48,7 @@ class message
/** @var string */
protected $sender_jabber = '';
/** @var int */
protected $sender_notify_type = NOTIFY_EMAIL;
protected $sender_notify_type = messenger_interface::NOTIFY_EMAIL;
/** @var array */
protected $recipients;
@@ -134,7 +136,7 @@ class message
* @param string $recipient_jabber
* @return void
*/
public function add_recipient($recipient_name, $recipient_address, $recipient_lang, $recipient_notify_type = NOTIFY_EMAIL, $recipient_username = '', $recipient_jabber = '')
public function add_recipient($recipient_name, $recipient_address, $recipient_lang, $recipient_notify_type = messenger_interface::NOTIFY_EMAIL, $recipient_username = '', $recipient_jabber = '')
{
$this->recipients[] = array(
'name' => $recipient_name,
@@ -250,7 +252,7 @@ class message
foreach ($messenger_collection_iterator as $messenger_method)
{
$messenger_method->set_use_queue(false);
if ($messenger_method->get_id() == $recipient['notify_type'] || $recipient['notify_type'] == NOTIFY_BOTH)
if ($messenger_method->get_id() == $recipient['notify_type'] || $recipient['notify_type'] == $messenger_method::NOTIFY_BOTH)
{
$messenger_method->template($this->template, $recipient['lang']);
$messenger_method->set_addresses($recipient);