Skip to content

Commit

Permalink
Updated pipeline contracts v0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
gplanchat committed Nov 16, 2023
1 parent 11fa39c commit 2eee14e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 23 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "library",
"require": {
"php": "^8.2",
"php-etl/pipeline-contracts": "0.4.*",
"php-etl/pipeline-contracts": "0.5.*",
"psr/container": "^1.0"
},
"license": "MIT",
Expand All @@ -23,7 +23,7 @@
"prefer-stable": true,
"extra": {
"branch-alias": {
"dev-main": "0.2.x-dev"
"dev-main": "0.3.x-dev"
}
}
}
32 changes: 16 additions & 16 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 9 additions & 4 deletions src/HookRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
use Kiboko\Contract\Pipeline\PipelineInterface;
use Kiboko\Contract\Pipeline\RejectionInterface;
use Kiboko\Contract\Pipeline\StateInterface;
use Kiboko\Contract\Pipeline\StepCodeInterface;
use Kiboko\Contract\Pipeline\StepRejectionInterface;
use Kiboko\Contract\Pipeline\StepStateInterface;
use Kiboko\Contract\Pipeline\TransformerInterface;
use Kiboko\Contract\Pipeline\TransformingInterface;
use Kiboko\Contract\Pipeline\WalkableInterface;
Expand All @@ -28,19 +31,21 @@ public function __construct(
}

public function transform(
StepCodeInterface $step,
TransformerInterface $transformer,
RejectionInterface $rejection,
StateInterface $state,
StepRejectionInterface $rejection,
StepStateInterface $state,
): TransformingInterface {
$this->pipeline->transform($transformer, $rejection, $this->state);

return $this;
}

public function load(
StepCodeInterface $step,
LoaderInterface $loader,
RejectionInterface $rejection,
StateInterface $state,
StepRejectionInterface $rejection,
StepStateInterface $state,
): LoadingInterface {
$this->pipeline->load($loader, $rejection, $this->state);

Expand Down
2 changes: 1 addition & 1 deletion src/HookRuntimeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
namespace Kiboko\Component\Runtime\Hook;

use Kiboko\Contract\Pipeline\LoadingInterface;
use Kiboko\Contract\Pipeline\RunnableInterface;
use Kiboko\Contract\Pipeline\TransformingInterface;
use Psr\Container\ContainerInterface;

interface HookRuntimeInterface extends TransformingInterface, LoadingInterface
{
public function feed(...$data): self;
/** @deprecated We should not provide access to the container, may there be one existing */
public function container(): ContainerInterface;
public function run(): array;
}

0 comments on commit 2eee14e

Please sign in to comment.