MailTemplateChannel   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 4
dl 0
loc 15
rs 10
c 1
b 0
f 1
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A send() 0 6 2
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