Test Failed
Push — develop ( f741b1...4c7784 )
by Alec
05:40
created

CounterFields::getDiff()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 0
cts 0
cp 0
crap 2
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 $path = 0;
21
22
    /** @var int */
23
    protected $length = 0;
24
25 9
    /** @var int */
26
    protected $initialValue = 0;
27 9
28
    /** @var int */
29
    protected $diff = 0;
30
31
    /** @var int */
32
    protected $step = 1;
33 12
34
    /** @var int */
35 12
    protected $bumpedForward = 0;
36
37
    /** @var int */
38
    protected $bumpedBack = 0;
39
40
    /** @var bool */
41
    protected $started = false;
42
43
    /**
44
     * @return int
45
     */
46
    public function getValue(): int
47
    {
48
        return $this->value;
49
    }
50
51
52
    /**
53
     * @return int
54
     */
55
    public function getPath(): int
56
    {
57
        return $this->path;
58
    }
59
60
    /**
61
     * @return int
62
     */
63
    public function getLength(): int
64
    {
65
        return $this->length;
66
    }
67
68
    /**
69
     * @return int
70
     */
71
    public function getInitialValue(): int
72
    {
73
        return $this->initialValue;
74
    }
75
76
    /**
77
     * @return int
78
     */
79
    public function getDiff(): int
80
    {
81
        return $this->diff = $this->value - $this->initialValue;
82
    }
83
84
85
    /**
86
     * @return int
87
     */
88
    public function getStep(): int
89
    {
90
        return $this->step;
91
    }
92
93
    /**
94
     * @return int
95
     */
96
    public function getBumpedForward(): int
97
    {
98
        return $this->bumpedForward;
99
    }
100
101
    /**
102
     * @return int
103
     */
104
    public function getBumpedBack(): int
105
    {
106
        return $this->bumpedBack;
107
    }
108
109
    /**
110
     * @return bool
111
     */
112
    public function isStarted(): bool
113
    {
114
        return $this->started;
115
    }
116
}
117