Location::getRow()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace CoenMooij\Sudoku\Puzzle;
6
7
/**
8
 * Class Location
9
 */
10
class Location
11
{
12
    /**
13
     * @var int
14
     */
15
    private $row;
16
17
    /**
18
     * @var int
19
     */
20
    private $column;
21
22
    public function __construct(int $row, int $column)
23
    {
24
        $this->row = $row;
25
        $this->column = $column;
26
    }
27
28
    public static function match(Location $location1, Location $location2): bool
29
    {
30
        return $location1->getRow() === $location2->getRow() && $location1->getColumn() === $location2->getColumn();
31
    }
32
33
    public function getRow(): int
34
    {
35
        return $this->row;
36
    }
37
38
    public function getColumn(): int
39
    {
40
        return $this->column;
41
    }
42
}
43