| Total Complexity | 7 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 9 | class Coordinate |
||
| 10 | { |
||
| 11 | /** |
||
| 12 | * @var int |
||
| 13 | */ |
||
| 14 | private $x; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var int |
||
| 18 | */ |
||
| 19 | private $y; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Coordinate constructor. |
||
| 23 | * @param $x |
||
| 24 | * @param $y |
||
| 25 | */ |
||
| 26 | public function __construct($x, $y) |
||
| 27 | { |
||
| 28 | $this->x = round($x); |
||
| 29 | $this->y = round($y); |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @return integer |
||
| 34 | */ |
||
| 35 | public function getX() |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @return integer |
||
| 42 | */ |
||
| 43 | public function getY() |
||
| 44 | { |
||
| 45 | return $this->y; |
||
| 46 | } |
||
| 47 | |||
| 48 | public function toArray() |
||
| 49 | { |
||
| 50 | return [ |
||
| 51 | $this->getX(), |
||
| 52 | $this->getY(), |
||
| 53 | ]; |
||
| 54 | } |
||
| 55 | |||
| 56 | public function __toString() |
||
| 59 | } |
||
| 60 | |||
| 61 | public function match(Coordinate $coordinate) |
||
| 64 | } |
||
| 65 | } |
||
| 66 |