Test Failed
Push — master ( 1068e7...19b6ab )
by Thomas
02:42
created

EmailLog::recipient()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
ccs 0
cts 2
cp 0
cc 1
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Tompec\EmailLog;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class EmailLog extends Model
8
{
9
    protected $guarded = [];
10
11
    protected $dates = [
12
        'delivered_at',
13
        'failed_at',
14
        'opened_at',
15
        'clicked_at',
16
    ];
17
18
    public function __construct(array $attributes = [])
19
    {
20
        if (! isset($this->table)) {
21
            $this->setTable(config('email-log.table_name'));
22
        }
23
        parent::__construct($attributes);
24
    }
25
26
    public function recipient()
27
    {
28
        return $this->morphTo();
29
    }
30
}
31