Completed
Push — master ( 6a7da5...1827cf )
by Alec
08:13 queued 02:32
created

CounterFields::getDiff()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * User: alec
4
 * Date: 30.11.18
5
 * Time: 17:42
6
 */
7
8
namespace AlecRabbit\Tools\Traits;
9
10
use AlecRabbit\Traits\GettableName;
11
12
trait CounterFields
13
{
14
    use GettableName;
15
16
    /** @var int */
17
    protected $value = 0;
18
19
    /** @var int */
20
    protected $max = 0;
21
22
    /** @var int */
23
    protected $min = 0;
24
25
    /** @var int */
26
    protected $path = 0;
27
28
    /** @var int */
29
    protected $length = 0;
30
31
    /** @var int */
32
    protected $initialValue = 0;
33
34
    /** @var int */
35
    protected $diff = 0;
36
37
    /** @var int */
38
    protected $step = 1;
39
40
    /** @var int */
41
    protected $bumpedForward = 0;
42
43
    /** @var int */
44
    protected $bumpedBack = 0;
45
46
    /** @var bool */
47
    protected $started = false;
48
49
    /**
50
     * @return int
51
     */
52 23
    public function getValue(): int
53
    {
54 23
        return $this->value;
55
    }
56
57
    /**
58
     * @return int
59
     */
60 7
    public function getMax(): int
61
    {
62 7
        return $this->max;
63
    }
64
65
    /**
66
     * @return int
67
     */
68 7
    public function getMin(): int
69
    {
70 7
        return $this->min;
71
    }
72
73
    /**
74
     * @return int
75
     */
76 11
    public function getPath(): int
77
    {
78 11
        return $this->path;
79
    }
80
81
    /**
82
     * @return int
83
     */
84 11
    public function getLength(): int
85
    {
86 11
        return $this->length;
87
    }
88
89
    /**
90
     * @return int
91
     */
92 19
    public function getInitialValue(): int
93
    {
94 19
        return $this->initialValue;
95
    }
96
97
    /**
98
     * @return int
99
     */
100 20
    public function getDiff(): int
101
    {
102 20
        return $this->diff = $this->value - $this->initialValue;
103
    }
104
105
106
    /**
107
     * @return int
108
     */
109 17
    public function getStep(): int
110
    {
111 17
        return $this->step;
112
    }
113
114
    /**
115
     * @return int
116
     */
117 10
    public function getBumpedForward(): int
118
    {
119 10
        return $this->bumpedForward;
120
    }
121
122
    /**
123
     * @return int
124
     */
125 10
    public function getBumpedBack(): int
126
    {
127 10
        return $this->bumpedBack;
128
    }
129
130
    /**
131
     * @return bool
132
     */
133 29
    public function isStarted(): bool
134
    {
135 29
        return $this->started;
136
    }
137
}
138