Completed
Pull Request — develop (#435)
by
unknown
16:46
created

GenericShape::getHashCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * @author Muhammad Hasan Shahid <[email protected]>
5
 * Mindline Analytics Gmbh
6
 */
7
8
namespace PhpOffice\PhpPresentation\Shape;
9
10
use PhpOffice\PhpPresentation\AbstractShape;
11
use PhpOffice\PhpPresentation\ComparableInterface;
12
use PhpOffice\PhpPresentation\Style\Border;
13
14
15
class GenericShape extends AbstractShape implements ComparableInterface
16
{
17
    /**
18
     * Create a new \PhpOffice\PhpPresentation\Shape\Ellipse instance
19
     *
20
     * @param int $fromX
21
     * @param int $fromY
22
     * @param int $toX
23
     * @param int $toY
24
     * @param int $rotation which takes the rotation for ellipse
25
     */
26
    public function __construct($fromX, $fromY, $toX, $toY, $rotation, $shape)
27
    {
28
        parent::__construct();
29
        $this->getBorder()->setLineStyle(Border::LINE_SINGLE);
30
31
        $this->setOffsetX($fromX);
32
        $this->setOffsetY($fromY);
33
        $this->setWidth($toX - $fromX);
34
        $this->setHeight($toY - $fromY);
35
        $this->setRotation($rotation);
36
        $this->setGenericShape($shape);
0 ignored issues
show
Bug introduced by
The method setGenericShape() does not seem to exist on object<PhpOffice\PhpPres...ion\Shape\GenericShape>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
37
38
    }
39
40
    /**
41
     * Get hash code
42
     *
43
     * @return string Hash code
44
     */
45
    public function getHashCode()
46
    {
47
        return md5($this->getBorder()->getLineStyle() . parent::getHashCode() . __CLASS__);
48
    }
49
50
}
51