add an additional static method Api\Mail\Smtp::mailbox_address()

as PHP 8.0 does not allow to call a non-static method static, even if $this is (conditionally) not used
This commit is contained in:
Ralf Becker 2021-09-29 10:10:48 +02:00
parent 707c57ecf0
commit 89923e25c4
2 changed files with 17 additions and 4 deletions

View File

@ -233,10 +233,23 @@ class Smtp
* default use $this->loginType
* @return string
*/
/*static*/ public function mailbox_addr($account,$domain=null,$mail_login_type=null)
public function mailbox_addr($account, $domain=null, $mail_login_type=null)
{
return self::mailbox_address($account, $domain ?? $this->defaultDomain, $mail_login_type ?? $this->loginType);
}
/**
* Build mailbox address for given account and mail_addr_type
*
* If $account is an array (with values for keys account_(id|lid|email), it does NOT call accounts class
*
* @param int|array $account account_id or whole account array with values for keys
* @param string $domain domain
* @param string $mail_login_type=null standard(uid), vmailmgr(uid@domain), email or uidNumber
* @return string
*/
static public function mailbox_address($account, string $domain, string $mail_login_type=null)
{
if (is_null($domain)) $domain = $this->defaultDomain;
if (is_null($mail_login_type)) $mail_login_type = $this->loginType;
switch($mail_login_type)
{

View File

@ -340,7 +340,7 @@ class Sql extends Mail\Smtp
}
}
// let interesed parties know account was update
// let interested parties know account was update
Api\Hooks::process(array(
'location' => 'mailaccount_userdata_updated',
'account_id' => $_uidnumber,