1 | <?php |
||
15 | class ArrayCollection implements ArrayAccess, Countable, IteratorAggregate |
||
16 | { |
||
17 | protected $branches = []; |
||
18 | |||
19 | 9 | public function offsetSet($offset, $value) { |
|
26 | |||
27 | 3 | public function offsetExists($offset) { |
|
30 | |||
31 | public function offsetUnset($offset) { |
||
34 | |||
35 | 24 | public function offsetGet($offset) { |
|
38 | |||
39 | 27 | public function count() |
|
43 | |||
44 | /** |
||
45 | * Iterator for the branches |
||
46 | * |
||
47 | * @return \ArrayIterator |
||
48 | */ |
||
49 | 30 | public function getIterator() |
|
53 | |||
54 | 6 | public function toArray() |
|
58 | } |
||
59 |
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: