ModelLog   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 30
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 2

3 Methods

Rating   Name   Duplication   Size   Complexity  
A subject() 0 4 1
A causer() 0 4 1
A reverter() 0 4 1
1
<?php
2
3
namespace Djunehor\EventRevert;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Illuminate\Database\Eloquent\SoftDeletes;
7
8
class ModelLog extends Model
9
{
10
    protected $fillable = [
11
        'causer_id',
12
        'causer_type',
13
        'subject_id',
14
        'subject_type',
15
        'action',
16
        'description',
17
        'old',
18
        'new',
19
        'route',
20
    ];
21
    use SoftDeletes;
22
23 5
    public function subject()
24
    {
25 5
        return $this->morphTo('subject');
26
    }
27
28 3
    public function causer()
29
    {
30 3
        return $this->morphTo('causer');
31
    }
32
33 3
    public function reverter()
34
    {
35 3
        return $this->morphTo('reverter');
36
    }
37
}
38