Point::getX()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * Grandstream-XMLApp
4
 *
5
 * Copyright (c) 2017 pudelek.org.pl
6
 *
7
 * @license MIT License (MIT)
8
 *
9
 * For the full copyright and license information, please view source file
10
 * that is bundled with this package in the file LICENSE
11
 *
12
 * @author  Marcin Pudełek <[email protected]>
13
 */
14
15
namespace mrcnpdlk\Grandstream\XMLApp\Helper;
16
17
/**
18
 * Class Point
19
 *
20
 * @package mrcnpdlk\Grandstream\XMLApp\Helper
21
 */
22
class Point
23
{
24
    /**
25
     * @var int
26
     */
27
    private $iX;
28
    /**
29
     * @var int
30
     */
31
    private $iY;
32
33
    /**
34
     * Point constructor.
35
     *
36
     * @param int $x
37
     * @param int $y
38
     */
39 3
    public function __construct(int $x, int $y)
40
    {
41 3
        $this->iX = $x;
42 3
        $this->iY = $y;
43 3
    }
44
45
    /**
46
     * @return int
47
     */
48 3
    public function getX()
49
    {
50 3
        return $this->iX;
51
    }
52
53
    /**
54
     * @return int
55
     */
56 3
    public function getY()
57
    {
58 3
        return $this->iY;
59
    }
60
61 1
    public function move(Vector $oVector)
62
    {
63 1
        $this->iX += $oVector->getDeltaX();
64 1
        $this->iY += $oVector->getDeltaY();
65
66 1
        return $this;
67
    }
68
}
69