Completed
Pull Request — develop (#230)
by Franck
07:48
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 5
    public function __construct($type)
56
    {
57 5
        $this->type = $type;
58 5
        return $this;
0 ignored issues
show
Bug introduced by
Constructors do not have meaningful return values, anything that is returned from here is discarded. Are you sure this is correct?
Loading history...
59
    }
60
61
    /**
62
     * @return mixed
63
     */
64 1
    public function getType()
65
    {
66 1
        return $this->type;
67
    }
68
69
    /**
70
     * @param mixed $type
71
     * @return string
72
     */
73 1
    public function setType($type)
74
    {
75 1
        $this->type = $type;
76 1
        return $this;
77
    }
78
79
    /**
80
     * @return int
81
     */
82
    public function getIdx()
83
    {
84
        return $this->idx;
85
    }
86
87
    /**
88
     * @param int $idx
89
     */
90
    public function setIdx($idx)
91
    {
92
        $this->idx = $idx;
93
    }
94
}
95