Completed
Pull Request — develop (#307)
by Franck
55:08 queued 52:20
created

Placeholder   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 75
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 76.92%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 75
ccs 10
cts 13
cp 0.7692
rs 10
c 2
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getType() 0 4 1
A setType() 0 5 1
A setIdx() 0 4 1
A getIdx() 0 4 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 2
    public function getType()
65
    {
66 2
        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 1
    public function getIdx()
83
    {
84 1
        return $this->idx;
85
    }
86
87
    /**
88
     * @param int $idx
89
     */
90
    public function setIdx($idx)
91
    {
92
        $this->idx = $idx;
93
    }
94
}
95