Variable::__construct()   A
last analyzed

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 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
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
}