Skip to content

[5.4] Check Htmlable contract instead of instanceof HtmlString in Mailer#18459

Merged
taylorotwell merged 2 commits into
laravel:5.4from
jbraud:mailer_htmlable_check
Mar 23, 2017
Merged

[5.4] Check Htmlable contract instead of instanceof HtmlString in Mailer#18459
taylorotwell merged 2 commits into
laravel:5.4from
jbraud:mailer_htmlable_check

Conversation

@jbraud

@jbraud jbraud commented Mar 23, 2017

Copy link
Copy Markdown
Contributor

Check the Htmlable contract instead of the concrete HtmlString class when rendering the view in the Mailer class.

Reason being, it then allows packages to hook into the Mailer code without needing to inherit from the class, which is an issue I've come across.

@jbraud jbraud changed the title Check Htmlable contract instead of instanceof HtmlString in Mailer [5.4] Check Htmlable contract instead of instanceof HtmlString in Mailer Mar 23, 2017
Comment thread src/Illuminate/Mail/Mailer.php Outdated
use Illuminate\Contracts\Queue\Factory as QueueContract;
use Illuminate\Contracts\Mail\Mailable as MailableContract;
use Illuminate\Contracts\Mail\MailQueue as MailQueueContract;
use Illuminate\Contracts\Support\Htmlable as HtmlableContract;

@JosephSilber JosephSilber Mar 23, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need to alias this (the others have been aliased due to conflicts or ambiguity).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair, spot of auto-pilot there. I'll sort that.

@taylorotwell taylorotwell merged commit c462ee9 into laravel:5.4 Mar 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants