Failed Conditions
Push — master ( 454d94...b2070f )
by Adrien
27:46
created

RowDimension::setRowIndex()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace PhpOffice\PhpSpreadsheet\Worksheet;
4
5
class RowDimension extends Dimension
6
{
7
    /**
8
     * Row index.
9
     *
10
     * @var int
11
     */
12
    private $rowIndex;
13
14
    /**
15
     * Row height (in pt).
16
     *
17
     * When this is set to a negative value, the row height should be ignored by IWriter
18
     *
19
     * @var float
20
     */
21
    private $height = -1;
22
23
    /**
24
     * ZeroHeight for Row?
25
     *
26
     * @var bool
27
     */
28
    private $zeroHeight = false;
29
30
    /**
31
     * Create a new RowDimension.
32
     *
33
     * @param int $pIndex Numeric row index
34
     */
35 237
    public function __construct($pIndex = 0)
36
    {
37
        // Initialise values
38 237
        $this->rowIndex = $pIndex;
39
40
        // set dimension as unformatted by default
41 237
        parent::__construct(null);
42 237
    }
43
44
    /**
45
     * Get Row Index.
46
     *
47
     * @return int
48
     */
49 49
    public function getRowIndex()
50
    {
51 49
        return $this->rowIndex;
52
    }
53
54
    /**
55
     * Set Row Index.
56
     *
57
     * @param int $pValue
58
     *
59
     * @return RowDimension
60
     */
61 2
    public function setRowIndex($pValue)
62
    {
63 2
        $this->rowIndex = $pValue;
64
65 2
        return $this;
66
    }
67
68
    /**
69
     * Get Row Height.
70
     *
71
     * @return float
72
     */
73 105
    public function getRowHeight()
74
    {
75 105
        return $this->height;
76
    }
77
78
    /**
79
     * Set Row Height.
80
     *
81
     * @param float $pValue
82
     *
83
     * @return RowDimension
84
     */
85 33
    public function setRowHeight($pValue)
86
    {
87 33
        $this->height = $pValue;
88
89 33
        return $this;
90
    }
91
92
    /**
93
     * Get ZeroHeight.
94
     *
95
     * @return bool
96
     */
97 85
    public function getZeroHeight()
98
    {
99 85
        return $this->zeroHeight;
100
    }
101
102
    /**
103
     * Set ZeroHeight.
104
     *
105
     * @param bool $pValue
106
     *
107
     * @return RowDimension
108
     */
109
    public function setZeroHeight($pValue)
110
    {
111
        $this->zeroHeight = $pValue;
112
113
        return $this;
114
    }
115
}
116