Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
22 / 22 |
|
100.00% |
15 / 15 |
CRAP | |
100.00% |
1 / 1 |
Shape | |
100.00% |
22 / 22 |
|
100.00% |
15 / 15 |
15 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getPoints | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setPoints | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getRoundness | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setRoundness | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getFrame | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setFrame | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getFill | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setFill | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getOutline | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setOutline | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getShadow | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setShadow | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
getExtrusion | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
setExtrusion | |
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 | * Shape style. |
22 | * |
23 | * @since 0.12.0 |
24 | * |
25 | * @todo Skew http://www.schemacentral.com/sc/ooxml/t-o_CT_Skew.html |
26 | */ |
27 | class Shape extends AbstractStyle |
28 | { |
29 | /** |
30 | * Points. |
31 | * |
32 | * - Arc: startAngle endAngle; 0 = top center, moving clockwise |
33 | * - Curve: from-x1,from-y1 to-x2,to-y2 control1-x,control1-y control2-x,control2-y |
34 | * - Line: from-x1,from-y1 to-x2,to-y2 |
35 | * - Polyline: x1,y1 x2,y2 ... |
36 | * - Rect and oval: Not applicable |
37 | * |
38 | * @var string |
39 | */ |
40 | private $points; |
41 | |
42 | /** |
43 | * Roundness measure of corners; 0 = straightest (rectangular); 1 = roundest (circle/oval). |
44 | * |
45 | * Only for rect |
46 | * |
47 | * @var float|int |
48 | */ |
49 | private $roundness; |
50 | |
51 | /** |
52 | * Frame. |
53 | * |
54 | * @var \PhpOffice\PhpWord\Style\Frame |
55 | */ |
56 | private $frame; |
57 | |
58 | /** |
59 | * Fill. |
60 | * |
61 | * @var \PhpOffice\PhpWord\Style\Fill |
62 | */ |
63 | private $fill; |
64 | |
65 | /** |
66 | * Outline. |
67 | * |
68 | * @var \PhpOffice\PhpWord\Style\Outline |
69 | */ |
70 | private $outline; |
71 | |
72 | /** |
73 | * Shadow. |
74 | * |
75 | * @var \PhpOffice\PhpWord\Style\Shadow |
76 | */ |
77 | private $shadow; |
78 | |
79 | /** |
80 | * 3D extrusion. |
81 | * |
82 | * @var \PhpOffice\PhpWord\Style\Extrusion |
83 | */ |
84 | private $extrusion; |
85 | |
86 | /** |
87 | * Create a new instance. |
88 | * |
89 | * @param array $style |
90 | */ |
91 | public function __construct($style = []) |
92 | { |
93 | $this->setStyleByArray($style); |
94 | } |
95 | |
96 | /** |
97 | * Get points. |
98 | * |
99 | * @return string |
100 | */ |
101 | public function getPoints() |
102 | { |
103 | return $this->points; |
104 | } |
105 | |
106 | /** |
107 | * Set points. |
108 | * |
109 | * @param string $value |
110 | * |
111 | * @return self |
112 | */ |
113 | public function setPoints($value = null) |
114 | { |
115 | $this->points = $value; |
116 | |
117 | return $this; |
118 | } |
119 | |
120 | /** |
121 | * Get roundness. |
122 | * |
123 | * @return float|int |
124 | */ |
125 | public function getRoundness() |
126 | { |
127 | return $this->roundness; |
128 | } |
129 | |
130 | /** |
131 | * Set roundness. |
132 | * |
133 | * @param float|int $value |
134 | * |
135 | * @return self |
136 | */ |
137 | public function setRoundness($value = null) |
138 | { |
139 | $this->roundness = $this->setNumericVal($value, null); |
140 | |
141 | return $this; |
142 | } |
143 | |
144 | /** |
145 | * Get frame. |
146 | * |
147 | * @return \PhpOffice\PhpWord\Style\Frame |
148 | */ |
149 | public function getFrame() |
150 | { |
151 | return $this->frame; |
152 | } |
153 | |
154 | /** |
155 | * Set frame. |
156 | * |
157 | * @param mixed $value |
158 | * |
159 | * @return self |
160 | */ |
161 | public function setFrame($value = null) |
162 | { |
163 | $this->setObjectVal($value, 'Frame', $this->frame); |
164 | |
165 | return $this; |
166 | } |
167 | |
168 | /** |
169 | * Get fill. |
170 | * |
171 | * @return \PhpOffice\PhpWord\Style\Fill |
172 | */ |
173 | public function getFill() |
174 | { |
175 | return $this->fill; |
176 | } |
177 | |
178 | /** |
179 | * Set fill. |
180 | * |
181 | * @param mixed $value |
182 | * |
183 | * @return self |
184 | */ |
185 | public function setFill($value = null) |
186 | { |
187 | $this->setObjectVal($value, 'Fill', $this->fill); |
188 | |
189 | return $this; |
190 | } |
191 | |
192 | /** |
193 | * Get outline. |
194 | * |
195 | * @return \PhpOffice\PhpWord\Style\Outline |
196 | */ |
197 | public function getOutline() |
198 | { |
199 | return $this->outline; |
200 | } |
201 | |
202 | /** |
203 | * Set outline. |
204 | * |
205 | * @param mixed $value |
206 | * |
207 | * @return self |
208 | */ |
209 | public function setOutline($value = null) |
210 | { |
211 | $this->setObjectVal($value, 'Outline', $this->outline); |
212 | |
213 | return $this; |
214 | } |
215 | |
216 | /** |
217 | * Get shadow. |
218 | * |
219 | * @return \PhpOffice\PhpWord\Style\Shadow |
220 | */ |
221 | public function getShadow() |
222 | { |
223 | return $this->shadow; |
224 | } |
225 | |
226 | /** |
227 | * Set shadow. |
228 | * |
229 | * @param mixed $value |
230 | * |
231 | * @return self |
232 | */ |
233 | public function setShadow($value = null) |
234 | { |
235 | $this->setObjectVal($value, 'Shadow', $this->shadow); |
236 | |
237 | return $this; |
238 | } |
239 | |
240 | /** |
241 | * Get 3D extrusion. |
242 | * |
243 | * @return \PhpOffice\PhpWord\Style\Extrusion |
244 | */ |
245 | public function getExtrusion() |
246 | { |
247 | return $this->extrusion; |
248 | } |
249 | |
250 | /** |
251 | * Set 3D extrusion. |
252 | * |
253 | * @param mixed $value |
254 | * |
255 | * @return self |
256 | */ |
257 | public function setExtrusion($value = null) |
258 | { |
259 | $this->setObjectVal($value, 'Extrusion', $this->extrusion); |
260 | |
261 | return $this; |
262 | } |
263 | } |