Point   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 59
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A x() 0 4 1
A y() 0 4 1
A equals() 0 4 2
1
<?php
2
3
/*
4
 * For the full copyright and license information, please view the LICENSE file
5
 * that was distributed with this source code.
6
 */
7
8
declare (
9
    strict_types = 1
10
);
11
12
namespace Component\Remote\BurzeDzisNet;
13
14
/**
15
 * Point represents the coordinates (DMS) for the specified locality according to the list of village
16
 * on the website
17
 *
18
 * @author Krzysztof Piasecki <[email protected]>
19
 */
20
class Point implements PointInterface
21
{
22
    /**
23
     * Coordinate x
24
     *
25
     * @var float coordinate X
26
     */
27
    private $x;
28
29
    /**
30
     * Coordinate y
31
     *
32
     * @var float coordinate y
33
     */
34
    private $y;
35
36
    /**
37
     * Point
38
     *
39
     * @param float $x coordinate x
40
     * @param float $y coordinate y
41
     */
42
    public function __construct(float $x, float $y)
43
    {
44
        $this->x = $x;
45
        $this->y = $y;
46
    }
47
48
    /**
49
     * Get x
50
     *
51
     * @return float coordinate x
52
     */
53
    public function x(): float
54
    {
55
        return $this->x;
56
    }
57
58
    /**
59
     * Get y
60
     *
61
     * @return float coordinate y
62
     */
63
    public function y(): float
64
    {
65
        return $this->y;
66
    }
67
68
    /**
69
     * Indicates whether some other Point is equal to this one
70
     *
71
     * @param PointInterface $point other Point
72
     * @return bool true if this Point is the equal to some other Point; false otherwise
73
     */
74
    public function equals(PointInterface $point): bool
75
    {
76
        return ($this->x() === $point->x()) && ($this->y() === $point->y());
77
    }
78
}
79