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