Completed
Pull Request — develop (#435)
by
unknown
19:30 queued 15:48
created

ArrowPointer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 32
ccs 0
cts 13
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
A getHashCode() 0 4 1
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