QueenPlacement::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
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