Variable   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Test Coverage

Coverage 80%

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 44
ccs 8
cts 10
cp 0.8
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A setValue() 0 3 1
A getValue() 0 3 1
A __construct() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Ctefan\Kiwi;
5
6
/**
7
 * The primary user constraint variable.
8
 */
9
class Variable
10
{
11
    /**
12
     * @var string
13
     */
14
    protected $name;
15
16
    /**
17
     * @var float
18
     */
19
    protected $value;
20
21
    /**
22
     * Variable constructor.
23
     *
24
     * @param string $name
25
     */
26 21
    public function __construct(string $name)
27
    {
28 21
        $this->name = $name;
29 21
    }
30
31
    /**
32
     * @return float
33
     */
34 18
    public function getValue(): float
35
    {
36 18
        return $this->value;
37
    }
38
39
    /**
40
     * @param float $value
41
     */
42 18
    public function setValue(float $value): void
43
    {
44 18
        $this->value = $value;
45 18
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function getName(): string
51
    {
52
        return $this->name;
53
    }
54
}