Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
13 / 13
100.00% covered (success)
100.00%
9 / 9
CRAP
100.00% covered (success)
100.00%
1 / 1
Indentation
100.00% covered (success)
100.00%
13 / 13
100.00% covered (success)
100.00%
9 / 9
9
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
 getLeft
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setLeft
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getRight
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setRight
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getFirstLine
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setFirstLine
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getHanging
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setHanging
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 * Paragraph indentation style.
23 *
24 * @see  http://www.schemacentral.com/sc/ooxml/t-w_CT_Ind.html
25 * @since 0.10.0
26 */
27class Indentation extends AbstractStyle
28{
29    /**
30     * Left indentation (twip).
31     *
32     * @var null|float
33     */
34    private $left = 0;
35
36    /**
37     * Right indentation (twip).
38     *
39     * @var null|float
40     */
41    private $right = 0;
42
43    /**
44     * Additional first line indentation (twip).
45     *
46     * @var null|float
47     */
48    private $firstLine = 0;
49
50    /**
51     * Indentation removed from first line (twip).
52     *
53     * @var null|float
54     */
55    private $hanging = 0;
56
57    /**
58     * Create a new instance.
59     *
60     * @param array $style
61     */
62    public function __construct($style = [])
63    {
64        $this->setStyleByArray($style);
65    }
66
67    /**
68     * Get left.
69     */
70    public function getLeft(): ?float
71    {
72        return $this->left;
73    }
74
75    /**
76     * Set left.
77     */
78    public function setLeft(?float $value): self
79    {
80        $this->left = $this->setNumericVal($value);
81
82        return $this;
83    }
84
85    /**
86     * Get right.
87     */
88    public function getRight(): ?float
89    {
90        return $this->right;
91    }
92
93    /**
94     * Set right.
95     */
96    public function setRight(?float $value): self
97    {
98        $this->right = $this->setNumericVal($value);
99
100        return $this;
101    }
102
103    /**
104     * Get first line.
105     */
106    public function getFirstLine(): ?float
107    {
108        return $this->firstLine;
109    }
110
111    /**
112     * Set first line.
113     */
114    public function setFirstLine(?float $value): self
115    {
116        $this->firstLine = $this->setNumericVal($value);
117
118        return $this;
119    }
120
121    /**
122     * Get hanging.
123     */
124    public function getHanging(): ?float
125    {
126        return $this->hanging;
127    }
128
129    /**
130     * Set hanging.
131     */
132    public function setHanging(?float $value = null): self
133    {
134        $this->hanging = $this->setNumericVal($value);
135
136        return $this;
137    }
138}