Passed
Pull Request — master (#451)
by Quetzy
05:20
created

Audit   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 9
dl 0
loc 32
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A auditable() 0 3 1
A user() 0 3 1
1
<?php
2
/**
3
 * This file is part of the Laravel Auditing package.
4
 *
5
 * @author     Antério Vieira <[email protected]>
6
 * @author     Quetzy Garcia  <[email protected]>
7
 * @author     Raphael França <[email protected]>
8
 * @copyright  2015-2018
9
 *
10
 * For the full copyright and license information,
11
 * please view the LICENSE.md file that was distributed
12
 * with this source code.
13
 */
14
15
namespace OwenIt\Auditing\Models;
16
17
use Illuminate\Database\Eloquent\Model;
18
use Illuminate\Database\Eloquent\Relations\MorphTo;
19
20
class Audit extends Model implements \OwenIt\Auditing\Contracts\Audit
21
{
22
    use \OwenIt\Auditing\Audit;
0 ignored issues
show
introduced by
The trait OwenIt\Auditing\Audit requires some properties which are not provided by OwenIt\Auditing\Models\Audit: $new_values, $url, $event, $auditable, $tags, $old_values, $user_agent, $ip_address, $user
Loading history...
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    protected $guarded = [];
28
29
    /**
30
     * {@inheritdoc}
31
     */
32
    protected $casts = [
33
        'old_values'    => 'json',
34
        'new_values'    => 'json',
35
        'auditable_id'  => 'integer',
36
    ];
37
38
    /**
39
     * {@inheritdoc}
40
     */
41 36
    public function auditable(): MorphTo
42
    {
43 36
        return $this->morphTo();
44
    }
45
46
    /**
47
     * {@inheritdoc}
48
     */
49 48
    public function user(): MorphTo
50
    {
51 48
        return $this->morphTo();
52
    }
53
}
54