Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
54 | public function testdoIterateOnArrayIterator() { |
||
55 | |||
56 | $expected = array( |
||
57 | 1001 , 42 |
||
58 | ); |
||
59 | |||
60 | $mappingIterator = new MappingIterator( new ArrayIterator( $expected ), function( $counter ) { |
||
61 | return $counter; |
||
62 | } ); |
||
63 | |||
64 | foreach ( $mappingIterator as $key => $value ) { |
||
65 | $this->assertEquals( |
||
66 | $expected[$key], |
||
67 | $value |
||
68 | ); |
||
69 | } |
||
70 | } |
||
71 | |||
73 |
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: