Completed
Push — develop ( f10e50...4f888d )
by Alec
03:20
created

TimerFields   A

Complexity

Total Complexity 13

Size/Duplication

Total Lines 142
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 27
dl 0
loc 142
ccs 26
cts 26
cp 1
rs 10
c 0
b 0
f 0
wmc 13

13 Methods

Rating   Name   Duplication   Size   Complexity  
A isStopped() 0 3 1
A getMinValue() 0 3 1
A getCreation() 0 3 1
A getLastValue() 0 3 1
A getElapsed() 0 3 1
A getStart() 0 3 1
A isNotStopped() 0 3 1
A getPrevious() 0 3 1
A getMaxValueIteration() 0 3 1
A getMaxValue() 0 3 1
A getMinValueIteration() 0 3 1
A getCount() 0 3 1
A getAverageValue() 0 3 1
1
<?php
2
/**
3
 * User: alec
4
 * Date: 30.11.18
5
 * Time: 17:41
6
 */
7
8
namespace AlecRabbit\Tools\Traits;
9
10
use AlecRabbit\Traits\GettableName;
11
12
trait TimerFields
13
{
14
    use GettableName;
15
16
    /** @var float */
17
    protected $previous;
18
19
    /** @var float */
20
    protected $start;
21
22
    /** @var float */
23
    protected $creation;
24
25
    /** @var float */
26
    protected $elapsed;
27
28
    /** @var bool */
29
    protected $stopped = false;
30
31
    /** @var float */
32
    protected $currentValue;
33
34
    /** @var float */
35
    protected $avgValue;
36
37
    /** @var float */
38
    protected $minValue;
39
40
    /** @var int */
41
    protected $minValueIteration = 0;
42
43
    /** @var float */
44
    protected $maxValue;
45
46
    /** @var int */
47
    protected $maxValueIteration = 0;
48
49
    /** @var int */
50
    protected $count = 0;
51
52
    /**
53
     * @return bool
54
     */
55 7
    public function isStopped(): bool
56
    {
57 7
        return $this->stopped;
58
    }
59
60
    /**
61
     * @return bool
62
     */
63 4
    public function isNotStopped(): bool
64
    {
65 4
        return !$this->stopped;
66
    }
67
68
    /**
69
     * @return float
70
     */
71 8
    public function getLastValue(): float
72
    {
73 8
        return $this->currentValue;
74
    }
75
76
    /**
77
     * @return float
78
     */
79 8
    public function getAverageValue(): float
80
    {
81 8
        return $this->avgValue;
82
    }
83
84
    /**
85
     * @return float
86
     */
87 3
    public function getMinValue(): float
88
    {
89 3
        return $this->minValue;
90
    }
91
92
    /**
93
     * @return float
94
     */
95 8
    public function getMaxValue(): float
96
    {
97 8
        return $this->maxValue;
98
    }
99
100
    /**
101
     * @return int
102
     */
103 8
    public function getCount(): int
104
    {
105 8
        return $this->count;
106
    }
107
108
    /**
109
     * @return int
110
     */
111 7
    public function getMinValueIteration(): int
112
    {
113 7
        return $this->minValueIteration;
114
    }
115
116
    /**
117
     * @return int
118
     */
119 7
    public function getMaxValueIteration(): int
120
    {
121 7
        return $this->maxValueIteration;
122
    }
123
124
    /**
125
     * @return float
126
     */
127 10
    public function getElapsed(): float
128
    {
129 10
        return $this->elapsed;
130
    }
131
132
    /**
133
     * @return float
134
     */
135 7
    public function getCreation(): float
136
    {
137 7
        return $this->creation;
138
    }
139
140
    /**
141
     * @return float
142
     */
143 7
    public function getPrevious(): float
144
    {
145 7
        return $this->previous;
146
    }
147
148
    /**
149
     * @return float
150
     */
151 7
    public function getStart(): float
152
    {
153 7
        return $this->start;
154
    }
155
}
156