Location   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
eloc 8
dl 0
loc 31
c 0
b 0
f 0
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getRow() 0 3 1
A match() 0 3 2
A getColumn() 0 3 1
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