Completed
Push — develop ( 097d50...7bd91a )
by Franck
13s
created

Doughnut::getHashCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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
 * @link        https://github.com/PHPOffice/PHPPresentation
14
 * @copyright   2009-2015 PHPPresentation contributors
15
 * @license     http://www.gnu.org/licenses/lgpl.txt LGPL version 3
16
 */
17
18
namespace PhpOffice\PhpPresentation\Shape\Chart\Type;
19
20
use PhpOffice\PhpPresentation\ComparableInterface;
21
22
/**
23
 * self
24
 */
25
class Doughnut extends AbstractTypePie implements ComparableInterface
26
{
27
    /**
28
     * Hole Size
29
     * @var int
30
     */
31
    protected $holeSize = 50;
32
33
    /**
34
     * @return int
35
     */
36
    public function getHoleSize()
37
    {
38
        return $this->holeSize;
39
    }
40
41
    /**
42
     * @param int $holeSize
43
     * @return Doughnut
44
     * @link https://msdn.microsoft.com/en-us/library/documentformat.openxml.drawing.charts.holesize(v=office.14).aspx
45
     */
46
    public function setHoleSize($holeSize = 50)
47
    {
48
        if ($holeSize < 10) {
49
            $holeSize = 10;
50
        }
51
        if ($holeSize > 90) {
52
            $holeSize = 90;
53
        }
54
        $this->holeSize = $holeSize;
55
        return $this;
56
    }
57
58
    /**
59
     * Get hash code
60
     *
61
     * @return string Hash code
62
     */
63
    public function getHashCode()
64
    {
65
        return md5(parent::getHashCode() . __CLASS__);
66
    }
67
}
68