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