Completed
Push — master ( 4f40d9...14b52b )
by Franck
17s
created

Placeholder::getType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * This file is part of PHPPresentation - A pure PHP library for reading and writing
4
 * presentations documents.
5
 *
6
 * PHPPresentation 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/PHPPresentation/contributors.
12
 *
13
 * @link        https://github.com/PHPOffice/PHPPresentation
14
 * @copyright   2009-2015 PHPPresentation contributors
15
 * @license     http://www.gnu.org/licenses/lgpl.txt LGPL version 3
16
 */
17
18
namespace PhpOffice\PhpPresentation\Shape;
19
20
class Placeholder
21
{
22
    /** Placeholder Type constants */
23
    const PH_TYPE_BODY = 'body';
24
    const PH_TYPE_CHART = 'chart';
25
    const PH_TYPE_SUBTITLE = 'subTitle';
26
    const PH_TYPE_TITLE = 'title';
27
    const PH_TYPE_FOOTER = 'ftr';
28
    const PH_TYPE_DATETIME = 'dt';
29
    const PH_TYPE_SLIDENUM = 'sldNum';
30
    /**
31
     * hasCustomPrompt
32
     * Indicates whether the placeholder should have a customer prompt.
33
     *
34
     * @var bool
35
     */
36
    protected $hasCustomPrompt;
37
    /**
38
     * idx
39
     * Specifies the index of the placeholder. This is used when applying templates or changing layouts to
40
     * match a placeholder on one template or master to another.
41
     *
42
     * @var int
43
     */
44
    protected $idx;
45
    /**
46
     * type
47
     * Specifies what content type the placeholder is to contains
48
     */
49
    protected $type;
50
51
    /**
52
     * Placeholder constructor.
53
     * @param $type
54
     */
55 8
    public function __construct($type)
56
    {
57 8
        $this->type = $type;
58 8
    }
59
60
    /**
61
     * @return mixed
62
     */
63 3
    public function getType()
64
    {
65 3
        return $this->type;
66
    }
67
68
    /**
69
     * @param mixed $type
70
     * @return Placeholder
71
     */
72 2
    public function setType($type)
73
    {
74 2
        $this->type = $type;
75 2
        return $this;
76
    }
77
78
    /**
79
     * @return int
80
     */
81 2
    public function getIdx()
82
    {
83 2
        return $this->idx;
84
    }
85
86
    /**
87
     * @param int $idx
88
     * @return Placeholder
89
     */
90 1
    public function setIdx($idx)
91
    {
92 1
        $this->idx = $idx;
93 1
        return $this;
94
    }
95
}
96