Total Complexity | 6 |
Total Lines | 45 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
22 | class IteratorNode extends IteratorIterator implements IteratorNodeInterface |
||
23 | { |
||
24 | /** |
||
25 | * IteratorNode constructor. |
||
26 | * |
||
27 | * @param array|Traversable $source |
||
28 | */ |
||
29 | 8 | public function __construct($source) |
|
30 | { |
||
31 | 8 | $iterator = is_array($source) ? new ArrayIterator($source) : $source; |
|
32 | 8 | parent::__construct($iterator); |
|
33 | 8 | } |
|
34 | |||
35 | /** |
||
36 | * @param callable|null $filter |
||
37 | * |
||
38 | * @return Iterator |
||
39 | */ |
||
40 | 2 | public function fetch(callable $filter = null) |
|
46 | } |
||
47 | |||
48 | /** |
||
49 | * @return string |
||
50 | */ |
||
51 | 1 | public function __toString() |
|
52 | { |
||
53 | 1 | return __CLASS__; |
|
54 | } |
||
55 | |||
56 | /** |
||
57 | * Return a clone of this object |
||
58 | * |
||
59 | * @note This will traverse the current iterator source to produce a clone, potentially moving past the point |
||
60 | * required |
||
61 | * |
||
62 | * @return static |
||
63 | */ |
||
64 | 1 | public function getClone() |
|
67 | } |
||
68 | } |
||
69 |