Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
29 | 2 | private function normalizeCoordinate(Coordinates $a_coordinate): Coordinates |
|
30 | { |
||
31 | 2 | if ($a_coordinate->coordinateX() > $this->max_coordinates->coordinateX()) { |
|
32 | 1 | return $this->normalizeCoordinate( |
|
33 | 1 | new Coordinates($a_coordinate->coordinateX() - $this->max_coordinates->coordinateX(), $a_coordinate->coordinateY() |
|
34 | ) |
||
35 | ); |
||
36 | } |
||
37 | 2 | if ($a_coordinate->coordinateY() > $this->max_coordinates->coordinateY()) { |
|
38 | 1 | return $this->normalizeCoordinate( |
|
39 | 1 | new Coordinates($a_coordinate->coordinateX(), $a_coordinate->coordinateY() - $this->max_coordinates->coordinateY() |
|
40 | ) |
||
41 | ); |
||
42 | } |
||
43 | |||
44 | 2 | return $a_coordinate; |
|
45 | } |
||
46 | } |
||
47 |