Skip to content

Commit f1b657a

Browse files
authored
Merge pull request #205 from MaxGoryunov/203
203
2 parents 410d8ca + a3139c2 commit f1b657a

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
6677
If the origin object is not an `Iterator` then wrap it in `TransparentIterator`:
6778

6879
```PHP

src/SavingIterator.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
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>

0 commit comments

Comments
 (0)