Schedulelog   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 3
Bugs 1 Features 0
Metric Value
wmc 2
c 3
b 1
f 0
lcom 0
cbo 0
dl 0
loc 30
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setStartAttribute() 0 4 1
A setEndAttribute() 0 4 1
1
<?php
2
3
namespace PendoNL\LaravelScheduleLogger;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Schedulelog extends Model
8
{
9
    protected $fillable = ['command_name', 'start', 'end'];
10
11
    public $timestamps = true;
12
13
    /**
14
     * Set start attribute. Multiply by 1000 to get milliseconds as integer.
15
     *
16
     * @param $value
17
     *
18
     * @return string
19
     */
20
    public function setStartAttribute($value)
21
    {
22
        $this->attributes['start'] = number_format($value * 1000, 0, '', '');
23
    }
24
25
    /**
26
     * Set end attribute. Multiply by 1000 to get milliseconds as integer.
27
     *
28
     * @param $value
29
     *
30
     * @return string
31
     */
32
    public function setEndAttribute($value)
33
    {
34
        $this->attributes['end'] = number_format($value * 1000, 0, '', '');
35
    }
36
}
37