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