Passed
Pull Request — master (#673)
by
unknown
06:25
created

Audit   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 18
Bugs 5 Features 2
Metric Value
eloc 7
c 18
b 5
f 2
dl 0
loc 21
ccs 3
cts 3
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A serializeDate() 0 3 1
1
<?php
2
3
namespace OwenIt\Auditing\Models;
4
5
use DateTimeInterface;
6
use Illuminate\Database\Eloquent\Model;
7
8
class Audit extends Model implements \OwenIt\Auditing\Contracts\Audit
9
{
10 1
    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...
11
12
    /**
13
     * {@inheritdoc}
14
     */
15
    protected $guarded = [];
16
17
    /**
18
     * {@inheritdoc}
19
     */
20
    protected $casts = [
21
        'old_values'   => 'json',
22
        'new_values'   => 'json',
23
        // Note: Please do not add 'auditable_id' in here, as it will break non-integer PK models
24
    ];
25
26 32
    protected function serializeDate(DateTimeInterface $date)
27
    {
28 32
        return $date->format('Y-m-d H:i:s');
29
    }
30
}
31