1 | <?php |
||
9 | class Point implements ArrayAccess |
||
10 | { |
||
11 | /** |
||
12 | * @var int |
||
13 | */ |
||
14 | protected $dimension; |
||
15 | |||
16 | /** |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $coordinates = []; |
||
20 | |||
21 | public function __construct(array $coordinates) |
||
26 | |||
27 | public function toArray(): array |
||
31 | |||
32 | /** |
||
33 | * @return int|mixed |
||
34 | */ |
||
35 | public function getDistanceWith(self $point, bool $precise = true) |
||
45 | |||
46 | /** |
||
47 | * @return mixed |
||
48 | */ |
||
49 | public function getClosest(array $points) |
||
71 | |||
72 | public function getCoordinates(): array |
||
76 | |||
77 | /** |
||
78 | * @param mixed $offset |
||
79 | */ |
||
80 | public function offsetExists($offset): bool |
||
84 | |||
85 | /** |
||
86 | * @param mixed $offset |
||
87 | * |
||
88 | * @return mixed |
||
89 | */ |
||
90 | public function offsetGet($offset) |
||
94 | |||
95 | /** |
||
96 | * @param mixed $offset |
||
97 | * @param mixed $value |
||
98 | */ |
||
99 | public function offsetSet($offset, $value): void |
||
103 | |||
104 | /** |
||
105 | * @param mixed $offset |
||
106 | */ |
||
107 | public function offsetUnset($offset): void |
||
111 | } |
||
112 |