Completed
Pull Request — develop (#435)
by
unknown
07:04
created

ArrowPointer::getHashCode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
/**
3
 * @author Muhammad Hasan Shahid <[email protected]>
4
 * Mindline Analytics Gmbh
5
 */
6
7
namespace PhpOffice\PhpPresentation\Shape;
8
9
use PhpOffice\PhpPresentation\AbstractShape;
10
use PhpOffice\PhpPresentation\ComparableInterface;
11
use PhpOffice\PhpPresentation\Style\Border;
12
13
/**
14
 * Class ArrowPointer
15
 * @package PhpOffice\PhpPresentation\Shape
16
 * This class is responsible for making arrow pointer
17
 */
18
class ArrowPointer extends AbstractShape implements ComparableInterface
19
{
20
    /**
21
     * Create a new \PhpOffice\PhpPresentation\Shape\ArrowPointer instance
22
     *
23
     * @param int $fromX
24
     * @param int $fromY
25
     * @param int $toX
26
     * @param int $toY
27
     */
28
    public function __construct($fromX, $fromY, $toX, $toY)
29
    {
30
        parent::__construct();
31
        $this->getBorder()->setLineStyle(Border::LINE_SINGLE);
32
33
        $this->setOffsetX($fromX);
34
        $this->setOffsetY($fromY);
35
        $this->setWidth($toX - $fromX);
36
        $this->setHeight($toY - $fromY);
37
    }
38
39
    /**
40
     * Get hash code
41
     *
42
     * @return string Hash code
43
     */
44
    public function getHashCode()
45
    {
46
        return md5($this->getBorder()->getLineStyle() . parent::getHashCode() . __CLASS__);
47
    }
48
49
}
50