Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
13 / 13 |
|
100.00% |
9 / 9 |
CRAP | |
100.00% |
1 / 1 |
Indentation | |
100.00% |
13 / 13 |
|
100.00% |
9 / 9 |
9 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getLeft | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setLeft | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getRight | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setRight | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getFirstLine | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setFirstLine | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getHanging | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setHanging | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | /** |
3 | * This file is part of PHPWord - A pure PHP library for reading and writing |
4 | * word processing documents. |
5 | * |
6 | * PHPWord is free software distributed under the terms of the GNU Lesser |
7 | * General Public License version 3 as published by the Free Software Foundation. |
8 | * |
9 | * For the full copyright and license information, please read the LICENSE |
10 | * file that was distributed with this source code. For the full list of |
11 | * contributors, visit https://github.com/PHPOffice/PHPWord/contributors. |
12 | * |
13 | * @see https://github.com/PHPOffice/PHPWord |
14 | * |
15 | * @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3 |
16 | */ |
17 | |
18 | namespace PhpOffice\PhpWord\Style; |
19 | |
20 | /** |
21 | * Paragraph indentation style. |
22 | * |
23 | * @see http://www.schemacentral.com/sc/ooxml/t-w_CT_Ind.html |
24 | * @since 0.10.0 |
25 | */ |
26 | class Indentation extends AbstractStyle |
27 | { |
28 | /** |
29 | * Left indentation (twip). |
30 | * |
31 | * @var float|int |
32 | */ |
33 | private $left = 0; |
34 | |
35 | /** |
36 | * Right indentation (twip). |
37 | * |
38 | * @var float|int |
39 | */ |
40 | private $right = 0; |
41 | |
42 | /** |
43 | * Additional first line indentation (twip). |
44 | * |
45 | * @var float|int |
46 | */ |
47 | private $firstLine = 0; |
48 | |
49 | /** |
50 | * Indentation removed from first line (twip). |
51 | * |
52 | * @var float|int |
53 | */ |
54 | private $hanging; |
55 | |
56 | /** |
57 | * Create a new instance. |
58 | * |
59 | * @param array $style |
60 | */ |
61 | public function __construct($style = []) |
62 | { |
63 | $this->setStyleByArray($style); |
64 | } |
65 | |
66 | /** |
67 | * Get left. |
68 | * |
69 | * @return float|int |
70 | */ |
71 | public function getLeft() |
72 | { |
73 | return $this->left; |
74 | } |
75 | |
76 | /** |
77 | * Set left. |
78 | * |
79 | * @param float|int $value |
80 | * |
81 | * @return self |
82 | */ |
83 | public function setLeft($value) |
84 | { |
85 | $this->left = $this->setNumericVal($value, $this->left); |
86 | |
87 | return $this; |
88 | } |
89 | |
90 | /** |
91 | * Get right. |
92 | * |
93 | * @return float|int |
94 | */ |
95 | public function getRight() |
96 | { |
97 | return $this->right; |
98 | } |
99 | |
100 | /** |
101 | * Set right. |
102 | * |
103 | * @param float|int $value |
104 | * |
105 | * @return self |
106 | */ |
107 | public function setRight($value) |
108 | { |
109 | $this->right = $this->setNumericVal($value, $this->right); |
110 | |
111 | return $this; |
112 | } |
113 | |
114 | /** |
115 | * Get first line. |
116 | * |
117 | * @return float|int |
118 | */ |
119 | public function getFirstLine() |
120 | { |
121 | return $this->firstLine; |
122 | } |
123 | |
124 | /** |
125 | * Set first line. |
126 | * |
127 | * @param float|int $value |
128 | * |
129 | * @return self |
130 | */ |
131 | public function setFirstLine($value) |
132 | { |
133 | $this->firstLine = $this->setNumericVal($value, $this->firstLine); |
134 | |
135 | return $this; |
136 | } |
137 | |
138 | /** |
139 | * Get hanging. |
140 | * |
141 | * @return float|int |
142 | */ |
143 | public function getHanging() |
144 | { |
145 | return $this->hanging; |
146 | } |
147 | |
148 | /** |
149 | * Set hanging. |
150 | * |
151 | * @param float|int $value |
152 | * |
153 | * @return self |
154 | */ |
155 | public function setHanging($value = null) |
156 | { |
157 | $this->hanging = $this->setNumericVal($value, $this->hanging); |
158 | |
159 | return $this; |
160 | } |
161 | } |