1
0
mirror of https://github.com/flarum/core.git synced 2025-07-16 14:26:25 +02:00

Add a docblock

This commit is contained in:
Franz Liedke
2019-11-13 20:32:41 +01:00
parent 6e4c605da1
commit 1bb39bbacb

View File

@ -38,6 +38,15 @@ final class BaseUrl
return $this->normalized;
}
/**
* Generate a valid e-mail address for this base URL's domain.
*
* This uses the given mailbox name and our already normalized host name to
* construct an email address.
*
* @param string $mailbox
* @return string
*/
public function toEmail(string $mailbox): string
{
$host = preg_replace('/^www\./i', '', parse_url($this->normalized, PHP_URL_HOST));