Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
10 / 10 |
|
100.00% |
7 / 7 |
CRAP | |
100.00% |
1 / 1 |
| Author | |
100.00% |
10 / 10 |
|
100.00% |
7 / 7 |
7 | |
100.00% |
1 / 1 |
| getIndex | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setIndex | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getInitials | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setInitials | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setName | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getHashCode | |
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\Comment; |
| 21 | |
| 22 | class Author |
| 23 | { |
| 24 | /** |
| 25 | * @var int |
| 26 | */ |
| 27 | protected $idxAuthor; |
| 28 | |
| 29 | /** |
| 30 | * @var string |
| 31 | */ |
| 32 | protected $initials; |
| 33 | |
| 34 | /** |
| 35 | * @var string |
| 36 | */ |
| 37 | protected $name; |
| 38 | |
| 39 | /** |
| 40 | * @return int |
| 41 | */ |
| 42 | public function getIndex() |
| 43 | { |
| 44 | return $this->idxAuthor; |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * @param int $idxAuthor |
| 49 | * |
| 50 | * @return Author |
| 51 | */ |
| 52 | public function setIndex($idxAuthor) |
| 53 | { |
| 54 | $this->idxAuthor = (int) $idxAuthor; |
| 55 | |
| 56 | return $this; |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * @return mixed |
| 61 | */ |
| 62 | public function getInitials() |
| 63 | { |
| 64 | return $this->initials; |
| 65 | } |
| 66 | |
| 67 | /** |
| 68 | * @param mixed $initials |
| 69 | * |
| 70 | * @return Author |
| 71 | */ |
| 72 | public function setInitials($initials) |
| 73 | { |
| 74 | $this->initials = $initials; |
| 75 | |
| 76 | return $this; |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * @return string |
| 81 | */ |
| 82 | public function getName() |
| 83 | { |
| 84 | return $this->name; |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * @param string $name |
| 89 | * |
| 90 | * @return Author |
| 91 | */ |
| 92 | public function setName($name) |
| 93 | { |
| 94 | $this->name = $name; |
| 95 | |
| 96 | return $this; |
| 97 | } |
| 98 | |
| 99 | /** |
| 100 | * Get hash code. |
| 101 | * |
| 102 | * @return string Hash code |
| 103 | */ |
| 104 | public function getHashCode(): string |
| 105 | { |
| 106 | return md5($this->getInitials() . $this->getName() . __CLASS__); |
| 107 | } |
| 108 | } |