Skip to content

Commit

Permalink
Adds a closure method to TransformerLoader to delegate generator stop…
Browse files Browse the repository at this point in the history
… signals to proxied loaders
  • Loading branch information
christianc1 committed Feb 22, 2025
1 parent f2a17fc commit d540e0c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/etl/src/Flow/ETL/Loader/TransformerLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use function Flow\ETL\DSL\{df, from_rows};
use Flow\ETL\{FlowContext, Loader, Rows, Transformation, Transformer};

final readonly class TransformerLoader implements Loader, OverridingLoader
final readonly class TransformerLoader implements Loader, OverridingLoader, Closure
{
public function __construct(
private Transformer|Transformation $transformer,
Expand All @@ -30,4 +30,11 @@ public function loaders() : array
{
return [$this->loader];
}

public function closure(FlowContext $context) : void
{
if ($this->loader instanceof Closure) {
$this->loader->closure($context);

Check warning on line 37 in src/core/etl/src/Flow/ETL/Loader/TransformerLoader.php

View check run for this annotation

Codecov / codecov/patch

src/core/etl/src/Flow/ETL/Loader/TransformerLoader.php#L37

Added line #L37 was not covered by tests
}
}
}

0 comments on commit d540e0c

Please sign in to comment.