Completed
Push — master ( ae4bd7...74685b )
by Felix
02:37
created

StatFrequentDomain::setCoverageAttribute()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php namespace SchulzeFelix\Stat\Objects;
2
3
use SchulzeFelix\DataTransferObject\DataTransferObject;
4
5
class StatFrequentDomain extends DataTransferObject
6
{
7
    protected $casts = [
8
        'top_ten_results' => 'integer',
9
        'results_analyzed' => 'integer',
10
        'coverage' => 'float',
11
        'analyzed_on' => 'date',
12
    ];
13
14
    public function setTopTenResultsAttribute($value)
15
    {
16
        return $this->attributes['top_ten_results'] = (int)$value;
17
    }
18
19
    public function setResultsAnalyzedAttribute($value)
20
    {
21
        return $this->attributes['results_analyzed'] = (int)$value;
22
    }
23
24
    public function setCoverageAttribute($value)
25
    {
26
        return $this->attributes['coverage'] = (float)$value;
27
    }
28
}
29