@@ -4,35 +4,35 @@ |
||
4 | 4 | |
5 | 5 | class Point |
6 | 6 | { |
7 | - public $x; |
|
8 | - public $y; |
|
9 | - public $points; |
|
10 | - public $ref; |
|
7 | + public $x; |
|
8 | + public $y; |
|
9 | + public $points; |
|
10 | + public $ref; |
|
11 | 11 | |
12 | - public function __construct($x, $y) |
|
13 | - { |
|
14 | - $this->x = $x; |
|
15 | - $this->y = $y; |
|
16 | - $this->points = []; |
|
17 | - $this->ref = "{$x}-{$y}"; |
|
18 | - } |
|
12 | + public function __construct($x, $y) |
|
13 | + { |
|
14 | + $this->x = $x; |
|
15 | + $this->y = $y; |
|
16 | + $this->points = []; |
|
17 | + $this->ref = "{$x}-{$y}"; |
|
18 | + } |
|
19 | 19 | |
20 | - public function addPoint(self $point): self |
|
21 | - { |
|
22 | - if (! in_array($point, $this->points)) { |
|
23 | - $this->points[] = $point; |
|
24 | - } |
|
20 | + public function addPoint(self $point): self |
|
21 | + { |
|
22 | + if (! in_array($point, $this->points)) { |
|
23 | + $this->points[] = $point; |
|
24 | + } |
|
25 | 25 | |
26 | - // add the reverse point |
|
27 | - if (! in_array($this, $point->points)) { |
|
28 | - $point->points[] = $this; |
|
29 | - } |
|
26 | + // add the reverse point |
|
27 | + if (! in_array($this, $point->points)) { |
|
28 | + $point->points[] = $this; |
|
29 | + } |
|
30 | 30 | |
31 | - return $this; |
|
32 | - } |
|
31 | + return $this; |
|
32 | + } |
|
33 | 33 | |
34 | - public function equals(self $point): bool |
|
35 | - { |
|
36 | - return $this->ref === $point->ref; |
|
37 | - } |
|
34 | + public function equals(self $point): bool |
|
35 | + { |
|
36 | + return $this->ref === $point->ref; |
|
37 | + } |
|
38 | 38 | } |
@@ -19,12 +19,12 @@ |
||
19 | 19 | |
20 | 20 | public function addPoint(self $point): self |
21 | 21 | { |
22 | - if (! in_array($point, $this->points)) { |
|
22 | + if (!in_array($point, $this->points)) { |
|
23 | 23 | $this->points[] = $point; |
24 | 24 | } |
25 | 25 | |
26 | 26 | // add the reverse point |
27 | - if (! in_array($this, $point->points)) { |
|
27 | + if (!in_array($this, $point->points)) { |
|
28 | 28 | $point->points[] = $this; |
29 | 29 | } |
30 | 30 |