push
travis-ci
7003 of 7671 relevant lines covered (91.29%)
419.83 hits per line
1 |
<?php
|
|
2 |
|
|
3 |
namespace Pinq\Iterators\Generators; |
|
4 |
|
|
5 |
use Pinq\Iterators\Common; |
|
6 |
use Pinq\Iterators\IAdapterIterator; |
|
7 |
|
|
8 |
/**
|
|
9 |
* Implementation of the adapter iterator for \ArrayIterator using the generator |
|
10 |
* |
|
11 |
* @author Elliot Levin <elliotlevin@hotmail.com> |
|
12 |
*/ |
|
13 |
class ArrayIteratorAdapter extends Generator implements IAdapterIterator |
|
14 |
{ |
|
15 |
use Common\AdapterIterator; |
|
16 |
|
|
17 |
public function __construct(\ArrayIterator $arrayIterator) |
|
18 |
{ |
× |
19 |
parent::__construct();
|
28 all except 329.3 ✔ |
20 |
self::__constructIterator($arrayIterator); |
28 all except 329.3 ✔ |
21 |
} |
28 all except 329.3 ✔ |
22 |
|
|
23 |
public function &getIterator() |
|
24 |
{ |
× |
25 |
foreach ($this->iterator as $key => &$value) { |
28 all except 329.3 ✔ |
26 |
yield $key => $value; |
4 all except 329.3 ✔ |
27 |
} |
28 all except 329.3 ✔ |
28 |
} |
28 all except 329.3 ✔ |
29 |
|
|
30 |
} |