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

EmailLog   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 24
rs 10
c 0
b 0
f 0
ccs 0
cts 7
cp 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 2
A recipient() 0 4 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
    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