Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
5 / 5
CRAP
100.00% covered (success)
100.00%
8 / 8
Placeholder
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
5 / 5
5
100.00% covered (success)
100.00%
8 / 8
 __construct
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 getType
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 setType
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 getIdx
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 setIdx
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
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 * @see        https://github.com/PHPOffice/PHPPresentation
14 *
15 * @copyright   2009-2015 PHPPresentation contributors
16 * @license     http://www.gnu.org/licenses/lgpl.txt LGPL version 3
17 */
18
19declare(strict_types=1);
20
21namespace PhpOffice\PhpPresentation\Shape;
22
23class Placeholder
24{
25    /** Placeholder Type constants */
26    public const PH_TYPE_BODY = 'body';
27    public const PH_TYPE_CHART = 'chart';
28    public const PH_TYPE_SUBTITLE = 'subTitle';
29    public const PH_TYPE_TITLE = 'title';
30    public const PH_TYPE_FOOTER = 'ftr';
31    public const PH_TYPE_DATETIME = 'dt';
32    public const PH_TYPE_SLIDENUM = 'sldNum';
33
34    /**
35     * Indicates whether the placeholder should have a customer prompt.
36     *
37     * @var bool
38     */
39    protected $hasCustomPrompt;
40
41    /**
42     * Specifies the index of the placeholder. This is used when applying templates or changing layouts to
43     * match a placeholder on one template or master to another.
44     *
45     * @var int|null
46     */
47    protected $idx;
48
49    /**
50     * Specifies what content type the placeholder is to contains.
51     *
52     * @var string
53     */
54    protected $type;
55
56    public function __construct(string $type)
57    {
58        $this->type = $type;
59    }
60
61    public function getType(): string
62    {
63        return $this->type;
64    }
65
66    public function setType(string $type): self
67    {
68        $this->type = $type;
69
70        return $this;
71    }
72
73    public function getIdx(): ?int
74    {
75        return $this->idx;
76    }
77
78    public function setIdx(int $idx): self
79    {
80        $this->idx = $idx;
81
82        return $this;
83    }
84}