Skip to content

Commit 175cd45

Browse files
committed
Fixed missing PorterAware injection in transformAsync().
1 parent 8437b5a commit 175cd45

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Porter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ private function transformRecords(RecordCollection $records, array $transformers
212212

213213
private function transformAsync(Iterator $records, array $transformers, $context): Producer
214214
{
215-
return new Producer(static function (\Closure $emit) use ($records, $transformers, $context) {
215+
return new Producer(function (\Closure $emit) use ($records, $transformers, $context) {
216216
while (yield $records->advance()) {
217217
$record = $records->getCurrent();
218218

@@ -221,6 +221,9 @@ private function transformAsync(Iterator $records, array $transformers, $context
221221
// TODO: Proper exception or separate async stack.
222222
throw new \RuntimeException('Cannot use sync transformer.');
223223
}
224+
if ($transformer instanceof PorterAware) {
225+
$transformer->setPorter($this);
226+
}
224227

225228
$record = yield $transformer->transformAsync($record, $context);
226229

0 commit comments

Comments
 (0)