Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong return type in Mailer.php #4

Closed
sergeybhub opened this issue Nov 14, 2023 · 1 comment
Closed

Wrong return type in Mailer.php #4

sergeybhub opened this issue Nov 14, 2023 · 1 comment

Comments

@sergeybhub
Copy link

 TypeError 

  HostBrook\LaravelDkim\Mailer::send(): Return value must be of type ?Illuminate\Mail\SentMessage, string returned

  at vendor/hostbrook/laravel-dkim/src/Mailer.php:30

public function send($view, array $data = [], $callback = null): ?SentMessage
{
        if ($view instanceof MailableContract) {
             return $this->sendMailable($view);
         }

I found these lines in sendMailable:

protected function sendMailable(MailableContract $mailable)
    {
        return $mailable instanceof ShouldQueue
                        ? $mailable->mailer($this->name)->queue($this->queue)
                        : $mailable->mailer($this->name)->send($this);
    }

and in my case (ShouldQueue) it returns string, as I see.

laravel 10.23.0

Maybe we can remove ?SendMessage to fix this?

@hostbrook
Copy link
Owner

wait, in the case of ShouldQueue - how the result of $mailable->mailer($this->name)->queue($this->queue) can be a string?
it doesn't make any sense, isn't it?

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

No branches or pull requests

2 participants