1 | <?php |
||
9 | class Point implements ArrayAccess, \Countable |
||
10 | { |
||
11 | /** |
||
12 | * @var int |
||
13 | */ |
||
14 | protected $dimension; |
||
15 | |||
16 | /** |
||
17 | * @var array |
||
18 | */ |
||
19 | protected $coordinates = []; |
||
20 | |||
21 | /** |
||
22 | * @var mixed |
||
23 | */ |
||
24 | protected $label; |
||
25 | |||
26 | /** |
||
27 | * @param mixed $label |
||
28 | */ |
||
29 | public function __construct(array $coordinates, $label = null) |
||
35 | |||
36 | public function toArray(): array |
||
40 | |||
41 | /** |
||
42 | * @return float|int |
||
43 | */ |
||
44 | public function getDistanceWith(self $point, bool $precise = true) |
||
54 | |||
55 | /** |
||
56 | * @param Point[] $points |
||
57 | */ |
||
58 | public function getClosest(array $points): ?self |
||
80 | |||
81 | public function getCoordinates(): array |
||
85 | |||
86 | /** |
||
87 | * @param mixed $offset |
||
88 | */ |
||
89 | public function offsetExists($offset): bool |
||
93 | |||
94 | /** |
||
95 | * @param mixed $offset |
||
96 | * |
||
97 | * @return mixed |
||
98 | */ |
||
99 | public function offsetGet($offset) |
||
103 | |||
104 | /** |
||
105 | * @param mixed $offset |
||
106 | * @param mixed $value |
||
107 | */ |
||
108 | public function offsetSet($offset, $value): void |
||
112 | |||
113 | /** |
||
114 | * @param mixed $offset |
||
115 | */ |
||
116 | public function offsetUnset($offset): void |
||
120 | |||
121 | public function count(): int |
||
125 | } |
||
126 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: