Passed
Push — master ( 1877a1...37d1bb )
by Gabriel
10:54
created

HasEmailDbMessageTrait::toMailDb()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 6
rs 10
1
<?php
2
3
namespace ByTIC\Notifications\Notifications;
4
5
use ByTIC\Notifications\Messages\Builder\EmailBuilder;
6
7
/**
8
 * Trait HasEmailDbMessageTrait
9
 * @package ByTIC\Notifications\Notifications
10
 */
11
trait HasEmailDbMessageTrait
12
{
13
    use HasMessageBuilderTrait;
14
15
    /**
16
     * @param $notifiable
17
     * @return mixed
18
     */
19
    public function toMailDb($notifiable)
20
    {
21
        /** @var EmailBuilder $emailBuilder */
22
        $emailBuilder = $this->generateMessageBuilder('mail');
23
        $emailBuilder->setNotifiable($notifiable);
24
        return $emailBuilder->createEmail();
25
    }
26
}
27