MailTemplateChannel::send()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 2
eloc 3
nc 2
nop 2
dl 0
loc 6
rs 10
c 1
b 0
f 1
1
<?php
2
3
namespace DansMaCulotte\MailTemplate;
4
5
use DansMaCulotte\MailTemplate\Drivers\Driver;
6
use Illuminate\Notifications\Notification;
7
8
class MailTemplateChannel
9
{
10
    /**
11
     * Send the given notification.
12
     *
13
     * @param mixed $notifiable
14
     * @param Notification $notification
15
     * @return void
16
     */
17
    public function send($notifiable, Notification $notification)
18
    {
19
        $message = $notification->toMailTemplate($notifiable);
0 ignored issues
show
Bug introduced by
The method toMailTemplate() does not exist on Illuminate\Notifications\Notification. It seems like you code against a sub-type of Illuminate\Notifications\Notification such as DansMaCulotte\MailTempla...sts\WelcomeNotification. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

19
        /** @scrutinizer ignore-call */ 
20
        $message = $notification->toMailTemplate($notifiable);
Loading history...
20
21
        if ($message instanceof Driver) {
22
            $message->send();
23
        }
24
    }
25
}
26