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

EmailLog::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 10
c 0
b 0
f 0
ccs 0
cts 5
cp 0
cc 2
nc 2
nop 1
crap 6
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