EmailDbChannel   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A send() 0 8 2
1
<?php
2
3
namespace ByTIC\Notifications\Channels;
4
5
use ByTIC\Notifications\Notification;
6
7
/**
8
 * Class MailChannel
9
 * @package ByTICModels\Notifications\Channels
10
 */
11
class EmailDbChannel extends AbstractChannel
12
{
13
    /**
14
     * Send the given notification.
15
     *
16
     * @param  mixed $notifiable
17
     * @param  Notification $notification
18
     * @return int
19
     */
20
    public function send($notifiable, Notification $notification)
21
    {
22
        $email = $notification->toMailDb($notifiable);
23
        $email->save();
24
        if ($email->id > 0) {
25
            return 1;
26
        }
27
        return 0;
28
    }
29
}
30