Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
37 / 37 |
|
100.00% |
14 / 14 |
CRAP | |
100.00% |
1 / 1 |
Line | |
100.00% |
37 / 37 |
|
100.00% |
14 / 14 |
14 | |
100.00% |
1 / 1 |
isFlip | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setFlip | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getConnectorType | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setConnectorType | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
1 | |||
getWeight | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setWeight | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getColor | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setColor | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getBeginArrow | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setBeginArrow | |
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
1 | |||
getEndArrow | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setEndArrow | |
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
1 | |||
getDash | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setDash | |
100.00% |
7 / 7 |
|
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 | * Line style. |
22 | */ |
23 | class Line extends Image |
24 | { |
25 | /** |
26 | * Connector types. |
27 | * |
28 | * @const string |
29 | */ |
30 | const CONNECTOR_TYPE_STRAIGHT = 'straight'; |
31 | |
32 | /** |
33 | * Arrow styles. |
34 | * |
35 | * @const string |
36 | */ |
37 | const ARROW_STYLE_BLOCK = 'block'; |
38 | const ARROW_STYLE_OPEN = 'open'; |
39 | const ARROW_STYLE_CLASSIC = 'classic'; |
40 | const ARROW_STYLE_DIAMOND = 'diamond'; |
41 | const ARROW_STYLE_OVAL = 'oval'; |
42 | |
43 | /** |
44 | * Dash styles. |
45 | * |
46 | * @const string |
47 | */ |
48 | const DASH_STYLE_DASH = 'dash'; |
49 | const DASH_STYLE_ROUND_DOT = 'rounddot'; |
50 | const DASH_STYLE_SQUARE_DOT = 'squaredot'; |
51 | const DASH_STYLE_DASH_DOT = 'dashdot'; |
52 | const DASH_STYLE_LONG_DASH = 'longdash'; |
53 | const DASH_STYLE_LONG_DASH_DOT = 'longdashdot'; |
54 | const DASH_STYLE_LONG_DASH_DOT_DOT = 'longdashdotdot'; |
55 | |
56 | /** |
57 | * flip Line. |
58 | * |
59 | * @var bool |
60 | */ |
61 | private $flip = false; |
62 | |
63 | /** |
64 | * connectorType. |
65 | * |
66 | * @var string |
67 | */ |
68 | private $connectorType = self::CONNECTOR_TYPE_STRAIGHT; |
69 | |
70 | /** |
71 | * Line Weight. |
72 | * |
73 | * @var int |
74 | */ |
75 | private $weight; |
76 | |
77 | /** |
78 | * Line color. |
79 | * |
80 | * @var string |
81 | */ |
82 | private $color; |
83 | |
84 | /** |
85 | * Dash style. |
86 | * |
87 | * @var string |
88 | */ |
89 | private $dash; |
90 | |
91 | /** |
92 | * Begin arrow. |
93 | * |
94 | * @var string |
95 | */ |
96 | private $beginArrow; |
97 | |
98 | /** |
99 | * End arrow. |
100 | * |
101 | * @var string |
102 | */ |
103 | private $endArrow; |
104 | |
105 | /** |
106 | * Get flip. |
107 | * |
108 | * @return bool |
109 | */ |
110 | public function isFlip() |
111 | { |
112 | return $this->flip; |
113 | } |
114 | |
115 | /** |
116 | * Set flip. |
117 | * |
118 | * @param bool $value |
119 | * |
120 | * @return self |
121 | */ |
122 | public function setFlip($value = false) |
123 | { |
124 | $this->flip = $this->setBoolVal($value, $this->flip); |
125 | |
126 | return $this; |
127 | } |
128 | |
129 | /** |
130 | * Get connectorType. |
131 | * |
132 | * @return string |
133 | */ |
134 | public function getConnectorType() |
135 | { |
136 | return $this->connectorType; |
137 | } |
138 | |
139 | /** |
140 | * Set connectorType. |
141 | * |
142 | * @param string $value |
143 | * |
144 | * @return self |
145 | */ |
146 | public function setConnectorType($value = null) |
147 | { |
148 | $enum = [ |
149 | self::CONNECTOR_TYPE_STRAIGHT, |
150 | ]; |
151 | $this->connectorType = $this->setEnumVal($value, $enum, $this->connectorType); |
152 | |
153 | return $this; |
154 | } |
155 | |
156 | /** |
157 | * Get weight. |
158 | * |
159 | * @return int |
160 | */ |
161 | public function getWeight() |
162 | { |
163 | return $this->weight; |
164 | } |
165 | |
166 | /** |
167 | * Set weight. |
168 | * |
169 | * @param int $value Weight in points |
170 | * |
171 | * @return self |
172 | */ |
173 | public function setWeight($value = null) |
174 | { |
175 | $this->weight = $this->setNumericVal($value, $this->weight); |
176 | |
177 | return $this; |
178 | } |
179 | |
180 | /** |
181 | * Get color. |
182 | * |
183 | * @return string |
184 | */ |
185 | public function getColor() |
186 | { |
187 | return $this->color; |
188 | } |
189 | |
190 | /** |
191 | * Set color. |
192 | * |
193 | * @param string $value |
194 | * |
195 | * @return self |
196 | */ |
197 | public function setColor($value = null) |
198 | { |
199 | $this->color = $value; |
200 | |
201 | return $this; |
202 | } |
203 | |
204 | /** |
205 | * Get beginArrow. |
206 | * |
207 | * @return string |
208 | */ |
209 | public function getBeginArrow() |
210 | { |
211 | return $this->beginArrow; |
212 | } |
213 | |
214 | /** |
215 | * Set beginArrow. |
216 | * |
217 | * @param string $value |
218 | * |
219 | * @return self |
220 | */ |
221 | public function setBeginArrow($value = null) |
222 | { |
223 | $enum = [ |
224 | self::ARROW_STYLE_BLOCK, self::ARROW_STYLE_CLASSIC, self::ARROW_STYLE_DIAMOND, |
225 | self::ARROW_STYLE_OPEN, self::ARROW_STYLE_OVAL, |
226 | ]; |
227 | $this->beginArrow = $this->setEnumVal($value, $enum, $this->beginArrow); |
228 | |
229 | return $this; |
230 | } |
231 | |
232 | /** |
233 | * Get endArrow. |
234 | * |
235 | * @return string |
236 | */ |
237 | public function getEndArrow() |
238 | { |
239 | return $this->endArrow; |
240 | } |
241 | |
242 | /** |
243 | * Set endArrow. |
244 | * |
245 | * @param string $value |
246 | * |
247 | * @return self |
248 | */ |
249 | public function setEndArrow($value = null) |
250 | { |
251 | $enum = [ |
252 | self::ARROW_STYLE_BLOCK, self::ARROW_STYLE_CLASSIC, self::ARROW_STYLE_DIAMOND, |
253 | self::ARROW_STYLE_OPEN, self::ARROW_STYLE_OVAL, |
254 | ]; |
255 | $this->endArrow = $this->setEnumVal($value, $enum, $this->endArrow); |
256 | |
257 | return $this; |
258 | } |
259 | |
260 | /** |
261 | * Get Dash. |
262 | * |
263 | * @return string |
264 | */ |
265 | public function getDash() |
266 | { |
267 | return $this->dash; |
268 | } |
269 | |
270 | /** |
271 | * Set Dash. |
272 | * |
273 | * @param string $value |
274 | * |
275 | * @return self |
276 | */ |
277 | public function setDash($value = null) |
278 | { |
279 | $enum = [ |
280 | self::DASH_STYLE_DASH, self::DASH_STYLE_DASH_DOT, self::DASH_STYLE_LONG_DASH, |
281 | self::DASH_STYLE_LONG_DASH_DOT, self::DASH_STYLE_LONG_DASH_DOT_DOT, self::DASH_STYLE_ROUND_DOT, |
282 | self::DASH_STYLE_SQUARE_DOT, |
283 | ]; |
284 | $this->dash = $this->setEnumVal($value, $enum, $this->dash); |
285 | |
286 | return $this; |
287 | } |
288 | } |