Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
33 | public function testdoIterateOnArray() { |
||
34 | |||
35 | $expected = array( |
||
36 | 1 , 42 |
||
37 | ); |
||
38 | |||
39 | $mappingIterator = new MappingIterator( $expected, function( $counter ) { |
||
40 | return $counter; |
||
41 | } ); |
||
42 | |||
43 | foreach ( $mappingIterator as $key => $value ) { |
||
44 | $this->assertEquals( |
||
45 | $expected[$key], |
||
46 | $value |
||
47 | ); |
||
48 | } |
||
49 | } |
||
50 | |||
70 |
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: