Column::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
/**
3
 * File containing the {@see Mistralys\WidthsCalculator\Calculator\Column} class.
4
 *
5
 * @package WidthsCalculator
6
 * @see Mistralys\WidthsCalculator\Calculator\Column
7
 */
8
9
declare (strict_types=1);
10
11
namespace Mistralys\WidthsCalculator\Calculator;
12
13
/**
14
 * Container class for a single column in the values list.
15
 *
16
 * @package WidthsCalculator
17
 * @author Sebastian Mordziol <[email protected]>
18
 */
19
class Column
20
{
21
    private string $name;
22
    private float $value;
23
    private bool $missing;
24
    
25
    public function __construct(string $name, float $value)
26
    {
27
        $this->name = $name;
28
        $this->value = $value;
29
        $this->missing = $value <= 0;
30
    }
31
    
32
    public function getName() : string
33
    {
34
        return $this->name;
35
    }
36
    
37
    public function isMissing() : bool
38
    {
39
        return $this->missing;
40
    }
41
    
42
    public function getValue() : float
43
    {
44
        return $this->value;
45
    }
46
    
47
    public function setValue(float $value) : void
48
    {
49
        $this->value = $value;
50
    }
51
    
52
    public function makeMissing() : void
53
    {
54
        $this->missing = true;
55
    }
56
}
57