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