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