Completed
Push — rover-kata ( e3c1b4...ca5c00 )
by Marcos
20:12 queued 04:03
created

Coordinates::coordinateY()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

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
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Kata\Rover;
4
5
final class Coordinates
6
{
7
    private $coordinateX;
8
    private $coordinateY;
9
10 2
    public function __construct(int $a_coordinateX, int $a_coordinateY)
11
    {
12 2
        $this->coordinateX = $a_coordinateX;
13 2
        $this->coordinateY = $a_coordinateY;
14 2
    }
15
16 2
    public function coordinateX(): int
17
    {
18 2
        return $this->coordinateX;
19
    }
20
21 2
    public function coordinateY(): int
22
    {
23 2
        return $this->coordinateY;
24
    }
25
26 1
    public function equals(Coordinates $coordinates): bool
27
    {
28 1
        if ($this->coordinateX === $coordinates->coordinateX() && $this->coordinateY === $coordinates->coordinateY()) {
29 1
            return true;
30
        }
31
32
        return false;
33
    }
34
}
35