Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
4 / 4
CRAP
100.00% covered (success)
100.00%
1 / 1
AbstractTypePie
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
4 / 4
5
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 setExplosion
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getExplosion
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getHashCode
100.00% covered (success)
100.00%
4 / 4
100.00% covered (success)
100.00%
1 / 1
2
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
18declare(strict_types=1);
19
20namespace PhpOffice\PhpPresentation\Shape\Chart\Type;
21
22/**
23 * \PhpOffice\PhpPresentation\Shape\Chart\Type\Bar.
24 */
25abstract class AbstractTypePie extends AbstractType
26{
27    /**
28     * Create a new self instance.
29     */
30    public function __construct()
31    {
32        $this->hasAxisX = false;
33        $this->hasAxisY = false;
34    }
35
36    /**
37     * Explosion of the Pie.
38     *
39     * @var int
40     */
41    protected $explosion = 0;
42
43    /**
44     * Set explosion.
45     */
46    public function setExplosion(int $value = 0): self
47    {
48        $this->explosion = $value;
49
50        return $this;
51    }
52
53    /**
54     * Get orientation.
55     */
56    public function getExplosion(): int
57    {
58        return $this->explosion;
59    }
60
61    /**
62     * Get hash code.
63     *
64     * @return string Hash code
65     */
66    public function getHashCode(): string
67    {
68        $hash = '';
69        foreach ($this->getSeries() as $series) {
70            $hash .= $series->getHashCode();
71        }
72
73        return $hash;
74    }
75}