EmailLog::recipient()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
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 6
    public function __construct(array $attributes = [])
19
    {
20 6
        if (! isset($this->table)) {
21 6
            $this->setTable(config('email-log.table_name'));
22
        }
23 6
        parent::__construct($attributes);
24 6
    }
25
26 1
    public function recipient()
27
    {
28 1
        return $this->morphTo();
29
    }
30
}
31