diff --git a/src/Constraint/Pipeline/IteratesLike.php b/src/Constraint/Pipeline/IteratesLike.php index 54c1a8c..33e755d 100644 --- a/src/Constraint/Pipeline/IteratesLike.php +++ b/src/Constraint/Pipeline/IteratesLike.php @@ -33,6 +33,7 @@ private function asIterator(iterable $iterable): \Iterator if ($iterable instanceof \Iterator) { return $iterable; } + return new \IteratorIterator($iterable); } diff --git a/src/Constraint/Pipeline/PipelineExtractsLike.php b/src/Constraint/Pipeline/PipelineExtractsLike.php index b6bc589..82c0e67 100644 --- a/src/Constraint/Pipeline/PipelineExtractsLike.php +++ b/src/Constraint/Pipeline/PipelineExtractsLike.php @@ -38,6 +38,7 @@ private function asIterator(iterable $iterable): \Iterator if ($iterable instanceof \Iterator) { return $iterable; } + return new \IteratorIterator($iterable); } diff --git a/src/Constraint/Pipeline/PipelineLoadsLike.php b/src/Constraint/Pipeline/PipelineLoadsLike.php index 58d2b53..728e077 100644 --- a/src/Constraint/Pipeline/PipelineLoadsLike.php +++ b/src/Constraint/Pipeline/PipelineLoadsLike.php @@ -43,6 +43,7 @@ private function asIterator(iterable $iterable): \Iterator if ($iterable instanceof \Iterator) { return $iterable; } + return new \IteratorIterator($iterable); } diff --git a/src/Constraint/Pipeline/PipelineTransformsLike.php b/src/Constraint/Pipeline/PipelineTransformsLike.php index b8e4ba3..8a1bbfd 100644 --- a/src/Constraint/Pipeline/PipelineTransformsLike.php +++ b/src/Constraint/Pipeline/PipelineTransformsLike.php @@ -43,6 +43,7 @@ private function asIterator(iterable $iterable): \Iterator if ($iterable instanceof \Iterator) { return $iterable; } + return new \IteratorIterator($iterable); } diff --git a/src/Constraint/Pipeline/PipelineWritesFile.php b/src/Constraint/Pipeline/PipelineWritesFile.php index fecb59c..f64dbc9 100644 --- a/src/Constraint/Pipeline/PipelineWritesFile.php +++ b/src/Constraint/Pipeline/PipelineWritesFile.php @@ -38,6 +38,7 @@ private function asIterator(iterable $iterable): \Iterator if ($iterable instanceof \Iterator) { return $iterable; } + return new \IteratorIterator($iterable); }