File tree Expand file tree Collapse file tree 2 files changed +11
-4
lines changed
Expand file tree Collapse file tree 2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,17 @@ $squares = new SavingIterator(
6363);
6464```
6565
66+ It is also possible to use ` SavingIterator ` without providing a target. In
67+ this case, it will use a default ` AddingIterator ` storage:
68+
69+ ``` PHP
70+ $squares = new SavingIterator(
71+ new SquaringIterator(
72+ [1, 2, 3, 4, 5, 6]
73+ )
74+ );
75+ ```
76+
6677If the origin object is not an ` Iterator ` then wrap it in ` TransparentIterator ` :
6778
6879``` PHP
Original file line number Diff line number Diff line change 99/**
1010 * Iterator which stores iterated values.
1111 *
12- * @todo #195:15min README has to mention that now it is not required to
13- * create ArrayAddingIterator and pass it into the constructor because now it
14- * is a default option.
15- *
1612 * @template TKey
1713 * @template TValue
1814 * @extends IteratorEnvelope<TKey, TValue>
You can’t perform that action at this time.
0 commit comments