Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
5 / 5
CRAP
100.00% covered (success)
100.00%
1 / 1
Extrusion
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
5 / 5
5
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
 getType
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setType
100.00% covered (success)
100.00%
3 / 3
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
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
18namespace PhpOffice\PhpWord\Style;
19
20/**
21 * 3D extrusion style.
22 *
23 * @see  http://www.schemacentral.com/sc/ooxml/t-o_CT_Extrusion.html
24 * @since 0.12.0
25 */
26class Extrusion extends AbstractStyle
27{
28    /**
29     * Type constants.
30     *
31     * @const string
32     */
33    const EXTRUSION_PARALLEL = 'parallel';
34    const EXTRUSION_PERSPECTIVE = 'perspective';
35
36    /**
37     * Type: parallel|perspective.
38     *
39     * @var string
40     */
41    private $type;
42
43    /**
44     * Color.
45     *
46     * @var string
47     */
48    private $color;
49
50    /**
51     * Create a new instance.
52     *
53     * @param array $style
54     */
55    public function __construct($style = [])
56    {
57        $this->setStyleByArray($style);
58    }
59
60    /**
61     * Get type.
62     *
63     * @return string
64     */
65    public function getType()
66    {
67        return $this->type;
68    }
69
70    /**
71     * Set pattern.
72     *
73     * @param string $value
74     *
75     * @return self
76     */
77    public function setType($value = null)
78    {
79        $enum = [self::EXTRUSION_PARALLEL, self::EXTRUSION_PERSPECTIVE];
80        $this->type = $this->setEnumVal($value, $enum, null);
81
82        return $this;
83    }
84
85    /**
86     * Get color.
87     *
88     * @return string
89     */
90    public function getColor()
91    {
92        return $this->color;
93    }
94
95    /**
96     * Set color.
97     *
98     * @param string $value
99     *
100     * @return self
101     */
102    public function setColor($value = null)
103    {
104        $this->color = $value;
105
106        return $this;
107    }
108}