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