Column   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 12
c 2
b 0
f 0
dl 0
loc 36
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A setValue() 0 3 1
A __construct() 0 5 1
A makeMissing() 0 3 1
A isMissing() 0 3 1
A getValue() 0 3 1
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