Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
7 / 7
CRAP
100.00% covered (success)
100.00%
1 / 1
TOC
100.00% covered (success)
100.00%
8 / 8
100.00% covered (success)
100.00%
7 / 7
7
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
 getTabPos
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setTabPos
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getTabLeader
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setTabLeader
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getIndent
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 setIndent
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 * TOC style.
22 */
23class TOC extends Tab
24{
25    /**
26     * Indent.
27     *
28     * @var float|int (twip)
29     */
30    private $indent = 200;
31
32    /**
33     * Create a new TOC Style.
34     */
35    public function __construct()
36    {
37        parent::__construct(self::TAB_STOP_RIGHT, 9062, self::TAB_LEADER_DOT);
38    }
39
40    /**
41     * Get Tab Position.
42     *
43     * @return float|int
44     */
45    public function getTabPos()
46    {
47        return $this->getPosition();
48    }
49
50    /**
51     * Set Tab Position.
52     *
53     * @param float|int $value
54     *
55     * @return self
56     */
57    public function setTabPos($value)
58    {
59        return $this->setPosition($value);
60    }
61
62    /**
63     * Get Tab Leader.
64     *
65     * @return string
66     */
67    public function getTabLeader()
68    {
69        return $this->getLeader();
70    }
71
72    /**
73     * Set Tab Leader.
74     *
75     * @param string $value
76     *
77     * @return self
78     */
79    public function setTabLeader($value = self::TAB_LEADER_DOT)
80    {
81        return $this->setLeader($value);
82    }
83
84    /**
85     * Get Indent.
86     *
87     * @return float|int
88     */
89    public function getIndent()
90    {
91        return $this->indent;
92    }
93
94    /**
95     * Set Indent.
96     *
97     * @param float|int $value
98     *
99     * @return self
100     */
101    public function setIndent($value)
102    {
103        $this->indent = $this->setNumericVal($value, $this->indent);
104
105        return $this;
106    }
107}