Total Complexity | 11 |
Total Lines | 124 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
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 |
|
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 |
|
136 | } |
||
137 | } |
||
138 |