ConditionalFormatValueObject   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 68
Duplicated Lines 0 %

Test Coverage

Coverage 52.63%

Importance

Changes 0
Metric Value
wmc 9
eloc 20
dl 0
loc 68
ccs 10
cts 19
cp 0.5263
rs 10
c 0
b 0
f 0

9 Methods

Rating   Name   Duplication   Size   Complexity  
A setGreaterThanOrEqual() 0 5 1
A getGreaterThanOrEqual() 0 3 1
A getCellFormula() 0 3 1
A getType() 0 3 1
A setCellFormula() 0 5 1
A setType() 0 5 1
A setValue() 0 5 1
A __construct() 0 5 1
A getValue() 0 3 1
1
<?php
2
3
namespace PhpOffice\PhpSpreadsheet\Style\ConditionalFormatting;
4
5
class ConditionalFormatValueObject
6
{
7
    private string $type;
8
9
    private null|float|int|string $value;
10
11
    private ?string $cellFormula;
12
13 10
    /**
14
     * For icon sets, determines whether this threshold value uses the greater
15 10
     * than or equal to operator. False indicates 'greater than' is used instead
16 10
     * of 'greater than or equal to'.
17 10
     */
18
    private ?bool $greaterThanOrEqual = null;
19
20 9
    public function __construct(string $type, null|float|int|string $value = null, ?string $cellFormula = null)
21
    {
22 9
        $this->type = $type;
23
        $this->value = $value;
24
        $this->cellFormula = $cellFormula;
25
    }
26
27
    public function getType(): string
28
    {
29
        return $this->type;
30
    }
31
32 9
    public function setType(string $type): self
33
    {
34 9
        $this->type = $type;
35
36
        return $this;
37
    }
38
39
    public function getValue(): null|float|int|string
40
    {
41
        return $this->value;
42
    }
43
44 6
    public function setValue(null|float|int|string $value): self
45
    {
46 6
        $this->value = $value;
47
48
        return $this;
49
    }
50
51
    public function getCellFormula(): ?string
52
    {
53
        return $this->cellFormula;
54
    }
55
56
    public function setCellFormula(?string $cellFormula): self
57
    {
58
        $this->cellFormula = $cellFormula;
59
60
        return $this;
61
    }
62
63
    public function getGreaterThanOrEqual(): ?bool
64
    {
65
        return $this->greaterThanOrEqual;
66
    }
67
68
    public function setGreaterThanOrEqual(?bool $greaterThanOrEqual): self
69
    {
70
        $this->greaterThanOrEqual = $greaterThanOrEqual;
71
72
        return $this;
73
    }
74
}
75