diff --git a/src/notification-mail/src/Message/MailMessage.php b/src/notification-mail/src/Message/MailMessage.php index 67eba7778..4fad1d554 100644 --- a/src/notification-mail/src/Message/MailMessage.php +++ b/src/notification-mail/src/Message/MailMessage.php @@ -15,10 +15,10 @@ use FriendsOfHyperf\Mail\Contract\Attachable; use FriendsOfHyperf\Mail\Contract\Mailer; use FriendsOfHyperf\Mail\Markdown; -use FriendsOfHyperf\Support\Contract\Htmlable; use Hyperf\Conditionable\Conditionable; use Hyperf\Context\ApplicationContext; use Hyperf\Contract\Arrayable; +use Hyperf\Contract\Htmlable; use Hyperf\ViewEngine\Contract\Renderable; use function Hyperf\Collection\collect; @@ -294,7 +294,7 @@ public function data(): array /** * Render the mail notification message into an HTML string. */ - public function render(): Htmlable|\Hyperf\ViewEngine\Contract\Htmlable + public function render(): Htmlable { $container = ApplicationContext::getContainer(); if (isset($this->view)) { diff --git a/src/notification-mail/src/Message/SimpleMessage.php b/src/notification-mail/src/Message/SimpleMessage.php index ffaa1b3f5..19fe99de2 100644 --- a/src/notification-mail/src/Message/SimpleMessage.php +++ b/src/notification-mail/src/Message/SimpleMessage.php @@ -12,7 +12,7 @@ namespace FriendsOfHyperf\Notification\Mail\Message; use FriendsOfHyperf\Notification\Mail\Action; -use FriendsOfHyperf\Support\Contract\Htmlable; +use Hyperf\Contract\Htmlable; class SimpleMessage { @@ -223,9 +223,9 @@ public function toArray(): array /** * Format the given line of text. */ - protected function formatLine(Htmlable|\Hyperf\ViewEngine\Contract\Htmlable|array|string $line): \Hyperf\ViewEngine\Contract\Htmlable|Htmlable|string + protected function formatLine(Htmlable|array|string $line): Htmlable|string { - if ($line instanceof Htmlable || $line instanceof \Hyperf\ViewEngine\Contract\Htmlable) { + if ($line instanceof Htmlable) { return $line; } diff --git a/src/support/src/Contract/Htmlable.php b/src/support/src/Contract/Htmlable.php index 78affe369..080acb25d 100644 --- a/src/support/src/Contract/Htmlable.php +++ b/src/support/src/Contract/Htmlable.php @@ -11,10 +11,14 @@ namespace FriendsOfHyperf\Support\Contract; -interface Htmlable -{ +class_alias(\Hyperf\Contract\Htmlable::class, Htmlable::class); + +if (! interface_exists(Htmlable::class)) { /** - * Get content as a string of HTML. + * Interface Htmlable. + * @deprecated since v3.2, will be removed in next major version, use `\Hyperf\Contract\Htmlable` instead */ - public function toHtml(): string; + interface Htmlable extends \Hyperf\Contract\Htmlable + { + } } diff --git a/src/support/src/HtmlString.php b/src/support/src/HtmlString.php index a1796d0ea..c3b30c238 100644 --- a/src/support/src/HtmlString.php +++ b/src/support/src/HtmlString.php @@ -11,10 +11,9 @@ namespace FriendsOfHyperf\Support; -use FriendsOfHyperf\Support\Contract\Htmlable; -use Stringable; +use Hyperf\Contract\Htmlable; -class HtmlString implements Htmlable, Stringable +class HtmlString implements Htmlable { /** * Create a new HTML string instance. diff --git a/types/Support/Support.php b/types/Support/Support.php index 1242871e4..db30c9e94 100644 --- a/types/Support/Support.php +++ b/types/Support/Support.php @@ -77,7 +77,7 @@ public function setMaxAttempts(int $maxAttempts): static return $this; } - public function getQueueName(): string + public function getPoolName(): string { return uniqid(); }