Passed
Push — master ( 602023...30e4d8 )
by Alec
11:05
created

SimpleCounterFields   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 46
ccs 8
cts 8
cp 1
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 3 1
A getBumped() 0 3 1
A getStep() 0 3 1
A getInitialValue() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace AlecRabbit\Counters\Core\Traits;
4
5
use AlecRabbit\Traits\GettableName;
6
use AlecRabbit\Traits\Startable;
7
8
trait SimpleCounterFields
9
{
10
    use GettableName, Startable;
11
12
    /** @var int */
13
    protected $value = 0;
14
15
    /** @var int */
16
    protected $initialValue = 0;
17
18
    /** @var int */
19
    protected $step = 1;
20
21
    /** @var int */
22
    protected $bumped = 0;
23
24
    /**
25
     * @return int
26
     */
27 11
    public function getValue(): int
28
    {
29 11
        return $this->value;
30
    }
31
32
    /**
33
     * @return int
34
     */
35 11
    public function getInitialValue(): int
36
    {
37 11
        return $this->initialValue;
38
    }
39
40
    /**
41
     * @return int
42
     */
43 11
    public function getStep(): int
44
    {
45 11
        return $this->step;
46
    }
47
48
    /**
49
     * @return int
50
     */
51 11
    public function getBumped(): int
52
    {
53 11
        return $this->bumped;
54
    }
55
}
56