QueenPlacement   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
c 1
b 0
f 0
dl 0
loc 26
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 3 1
A column() 0 3 1
A __construct() 0 4 1
A row() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Stratadox\PuzzleSolver\Puzzle\NQueens;
4
5
use Stratadox\PuzzleSolver\Move;
6
7
final class QueenPlacement implements Move
8
{
9
    /** @var int */
10
    private $row;
11
    /** @var int */
12
    private $column;
13
14
    public function __construct(int $row, int $column)
15
    {
16
        $this->row = $row;
17
        $this->column = $column;
18
    }
19
20
    public function row(): int
21
    {
22
        return $this->row;
23
    }
24
25
    public function column(): int
26
    {
27
        return $this->column;
28
    }
29
30
    public function __toString(): string
31
    {
32
        return $this->column . ',' . $this->row;
33
    }
34
}
35