Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1aa0c58

Browse files
committed
Keep lazy iterator alive
1 parent 6f0a3a9 commit 1aa0c58

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

src/Document/Transformer/ChainTransformer.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,12 @@
1515

1616
final class ChainTransformer implements TransformerInterface
1717
{
18-
/**
19-
* @var TransformerInterface[]
20-
*/
21-
private readonly array $transformers;
22-
2318
/**
2419
* @param iterable<TransformerInterface> $transformers
2520
*/
26-
public function __construct(iterable $transformers)
27-
{
28-
$this->transformers = $transformers instanceof \Traversable ? iterator_to_array($transformers) : $transformers;
21+
public function __construct(
22+
private readonly iterable $transformers,
23+
) {
2924
}
3025

3126
public function transform(iterable $documents, array $options = []): iterable

0 commit comments

Comments
 (0)