Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
15 / 15 |
|
100.00% |
11 / 11 |
CRAP | |
100.00% |
1 / 1 |
| Comment | |
100.00% |
15 / 15 |
|
100.00% |
11 / 11 |
11 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getAuthor | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setAuthor | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getDate | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setDate | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getText | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setText | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getHeight | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setHeight | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getWidth | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setWidth | |
100.00% |
1 / 1 |
|
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 | use PhpOffice\PhpPresentation\AbstractShape; |
| 23 | use PhpOffice\PhpPresentation\ComparableInterface; |
| 24 | use PhpOffice\PhpPresentation\Shape\Comment\Author; |
| 25 | |
| 26 | /** |
| 27 | * Comment shape. |
| 28 | */ |
| 29 | class Comment extends AbstractShape implements ComparableInterface |
| 30 | { |
| 31 | /** |
| 32 | * @var null|Author |
| 33 | */ |
| 34 | protected $author; |
| 35 | |
| 36 | /** |
| 37 | * @var int |
| 38 | */ |
| 39 | protected $dtComment; |
| 40 | |
| 41 | /** |
| 42 | * @var string |
| 43 | */ |
| 44 | protected $text; |
| 45 | |
| 46 | public function __construct() |
| 47 | { |
| 48 | parent::__construct(); |
| 49 | $this->setDate(time()); |
| 50 | } |
| 51 | |
| 52 | public function getAuthor(): ?Author |
| 53 | { |
| 54 | return $this->author; |
| 55 | } |
| 56 | |
| 57 | public function setAuthor(Author $author): self |
| 58 | { |
| 59 | $this->author = $author; |
| 60 | |
| 61 | return $this; |
| 62 | } |
| 63 | |
| 64 | /** |
| 65 | * @return int |
| 66 | */ |
| 67 | public function getDate() |
| 68 | { |
| 69 | return $this->dtComment; |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * @param int $dtComment timestamp of the comment |
| 74 | * |
| 75 | * @return Comment |
| 76 | */ |
| 77 | public function setDate($dtComment) |
| 78 | { |
| 79 | $this->dtComment = (int) $dtComment; |
| 80 | |
| 81 | return $this; |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * @return string |
| 86 | */ |
| 87 | public function getText() |
| 88 | { |
| 89 | return $this->text; |
| 90 | } |
| 91 | |
| 92 | /** |
| 93 | * @param string $text |
| 94 | * |
| 95 | * @return Comment |
| 96 | */ |
| 97 | public function setText($text = '') |
| 98 | { |
| 99 | $this->text = $text; |
| 100 | |
| 101 | return $this; |
| 102 | } |
| 103 | |
| 104 | /** |
| 105 | * Comment has not height. |
| 106 | * |
| 107 | * @return null|int |
| 108 | */ |
| 109 | public function getHeight() |
| 110 | { |
| 111 | return null; |
| 112 | } |
| 113 | |
| 114 | /** |
| 115 | * Set Height. |
| 116 | * |
| 117 | * @return $this |
| 118 | */ |
| 119 | public function setHeight(int $pValue = 0) |
| 120 | { |
| 121 | return $this; |
| 122 | } |
| 123 | |
| 124 | /** |
| 125 | * Comment has not width. |
| 126 | * |
| 127 | * @return null|int |
| 128 | */ |
| 129 | public function getWidth() |
| 130 | { |
| 131 | return null; |
| 132 | } |
| 133 | |
| 134 | /** |
| 135 | * Set Width. |
| 136 | * |
| 137 | * @return self |
| 138 | */ |
| 139 | public function setWidth(int $pValue = 0) |
| 140 | { |
| 141 | return $this; |
| 142 | } |
| 143 | } |