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