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