Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
21 / 21 |
|
100.00% |
14 / 14 |
CRAP | |
100.00% |
1 / 1 |
| Metadata | |
100.00% |
21 / 21 |
|
100.00% |
14 / 14 |
14 | |
100.00% |
1 / 1 |
| setTitle | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| setAuthor | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| setSubject | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| setCreator | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| setProducer | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| setCreationDate | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| setModDate | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getTitle | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getAuthor | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getSubject | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getCreator | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getProducer | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getCreationDate | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getModDate | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Pop PHP Framework (https://www.popphp.org/) |
| 4 | * |
| 5 | * @link https://github.com/popphp/popphp-framework |
| 6 | * @author Nick Sagona, III <dev@noladev.com> |
| 7 | * @copyright Copyright (c) 2009-2026 NOLA Interactive, LLC. |
| 8 | * @license https://www.popphp.org/license New BSD License |
| 9 | */ |
| 10 | |
| 11 | /** |
| 12 | * @namespace |
| 13 | */ |
| 14 | namespace Pop\Pdf\Document; |
| 15 | |
| 16 | /** |
| 17 | * Pdf document metadata class |
| 18 | * |
| 19 | * @category Pop |
| 20 | * @package Pop\Pdf |
| 21 | * @author Nick Sagona, III <dev@noladev.com> |
| 22 | * @copyright Copyright (c) 2009-2026 NOLA Interactive, LLC. |
| 23 | * @license https://www.popphp.org/license New BSD License |
| 24 | * @version 5.2.7 |
| 25 | */ |
| 26 | class Metadata |
| 27 | { |
| 28 | |
| 29 | /** |
| 30 | * PDF info object title |
| 31 | * @var string |
| 32 | */ |
| 33 | protected string $title = 'Pop PDF'; |
| 34 | |
| 35 | /** |
| 36 | * PDF info object author |
| 37 | * @var string |
| 38 | */ |
| 39 | protected string $author = 'Pop PDF'; |
| 40 | |
| 41 | /** |
| 42 | * PDF info object subject |
| 43 | * @var string |
| 44 | */ |
| 45 | protected string $subject = 'Pop PDF'; |
| 46 | |
| 47 | /** |
| 48 | * PDF info object creator |
| 49 | * @var string |
| 50 | */ |
| 51 | protected string $creator = 'Pop PDF'; |
| 52 | |
| 53 | /** |
| 54 | * PDF info object producer |
| 55 | * @var string |
| 56 | */ |
| 57 | protected string $producer = 'Pop PDF'; |
| 58 | |
| 59 | /** |
| 60 | * PDF info object creation date |
| 61 | * @var ?string |
| 62 | */ |
| 63 | protected ?string $creationDate = null; |
| 64 | |
| 65 | /** |
| 66 | * PDF info object modification date |
| 67 | * @var ?string |
| 68 | */ |
| 69 | protected ?string $modDate = null; |
| 70 | |
| 71 | /** |
| 72 | * Set the info object title |
| 73 | * |
| 74 | * @param string $title |
| 75 | * @return Metadata |
| 76 | */ |
| 77 | public function setTitle(string $title): Metadata |
| 78 | { |
| 79 | $this->title = $title; |
| 80 | return $this; |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Set the info object author |
| 85 | * |
| 86 | * @param string $author |
| 87 | * @return Metadata |
| 88 | */ |
| 89 | public function setAuthor(string $author): Metadata |
| 90 | { |
| 91 | $this->author = $author; |
| 92 | return $this; |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * Set the info object subject |
| 97 | * |
| 98 | * @param string $subject |
| 99 | * @return Metadata |
| 100 | */ |
| 101 | public function setSubject(string $subject): Metadata |
| 102 | { |
| 103 | $this->subject = $subject; |
| 104 | return $this; |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * Set the info object creator |
| 109 | * |
| 110 | * @param string $creator |
| 111 | * @return Metadata |
| 112 | */ |
| 113 | public function setCreator(string $creator): Metadata |
| 114 | { |
| 115 | $this->creator = $creator; |
| 116 | return $this; |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * Set the info object producer |
| 121 | * |
| 122 | * @param string $producer |
| 123 | * @return Metadata |
| 124 | */ |
| 125 | public function setProducer(string $producer): Metadata |
| 126 | { |
| 127 | $this->producer = $producer; |
| 128 | return $this; |
| 129 | } |
| 130 | |
| 131 | /** |
| 132 | * Set the info object creation date |
| 133 | * |
| 134 | * @param string $date |
| 135 | * @return Metadata |
| 136 | */ |
| 137 | public function setCreationDate(string $date): Metadata |
| 138 | { |
| 139 | $this->creationDate = $date; |
| 140 | return $this; |
| 141 | } |
| 142 | |
| 143 | /** |
| 144 | * Set the info object modification date |
| 145 | * |
| 146 | * @param string $date |
| 147 | * @return Metadata |
| 148 | */ |
| 149 | public function setModDate(string $date): Metadata |
| 150 | { |
| 151 | $this->modDate = $date; |
| 152 | return $this; |
| 153 | } |
| 154 | |
| 155 | /** |
| 156 | * Get the info object title |
| 157 | * |
| 158 | * @return string |
| 159 | */ |
| 160 | public function getTitle(): string |
| 161 | { |
| 162 | return $this->title; |
| 163 | } |
| 164 | |
| 165 | /** |
| 166 | * Get the info object author |
| 167 | * |
| 168 | * @return string |
| 169 | */ |
| 170 | public function getAuthor(): string |
| 171 | { |
| 172 | return $this->author; |
| 173 | } |
| 174 | |
| 175 | /** |
| 176 | * Get the info object subject |
| 177 | * |
| 178 | * @return string |
| 179 | */ |
| 180 | public function getSubject(): string |
| 181 | { |
| 182 | return $this->subject; |
| 183 | } |
| 184 | |
| 185 | /** |
| 186 | * Get the info object creator |
| 187 | * |
| 188 | * @return string |
| 189 | */ |
| 190 | public function getCreator(): string |
| 191 | { |
| 192 | return $this->creator; |
| 193 | } |
| 194 | |
| 195 | /** |
| 196 | * Get the info object producer |
| 197 | * |
| 198 | * @return string |
| 199 | */ |
| 200 | public function getProducer(): string |
| 201 | { |
| 202 | return $this->producer; |
| 203 | } |
| 204 | |
| 205 | /** |
| 206 | * Get the info object creation date |
| 207 | * |
| 208 | * @return ?string |
| 209 | */ |
| 210 | public function getCreationDate(): ?string |
| 211 | { |
| 212 | return $this->creationDate; |
| 213 | } |
| 214 | |
| 215 | /** |
| 216 | * Get the info object modification date |
| 217 | * |
| 218 | * @return ?string |
| 219 | */ |
| 220 | public function getModDate(): ?string |
| 221 | { |
| 222 | return $this->modDate; |
| 223 | } |
| 224 | |
| 225 | } |