66
77use Kiboko \Component \Pipeline \Pipeline ;
88use Kiboko \Component \Runtime \Pipeline \Console as PipelineConsoleRuntime ;
9+ use Kiboko \Component \Runtime \Pipeline \MemoryState ;
910use Kiboko \Component \Runtime \Pipeline \PipelineRuntimeInterface ;
10- use Kiboko \Component \State ;
1111use Kiboko \Contract \Pipeline \ExtractorInterface ;
1212use Kiboko \Contract \Pipeline \LoaderInterface ;
1313use Kiboko \Contract \Pipeline \PipelineRunnerInterface ;
1414use Kiboko \Contract \Pipeline \RejectionInterface ;
1515use Kiboko \Contract \Pipeline \StateInterface ;
16+ use Kiboko \Contract \Pipeline \StepCodeInterface ;
17+ use Kiboko \Contract \Pipeline \StepRejectionInterface ;
18+ use Kiboko \Contract \Pipeline \StepStateInterface ;
1619use Kiboko \Contract \Pipeline \TransformerInterface ;
1720use Kiboko \Contract \Satellite \CodeInterface ;
1821use Symfony \Component \Console \Output \ConsoleOutput ;
@@ -26,7 +29,7 @@ public function __construct(
2629 callable $ factory ,
2730 private readonly ConsoleOutput $ output ,
2831 private readonly PipelineRunnerInterface $ pipelineRunner ,
29- private readonly State \ StateOutput \ Workflow $ state ,
32+ private readonly Workflow $ state ,
3033 private readonly CodeInterface $ code ,
3134 ) {
3235 $ this ->queuedCalls [] = static function (PipelineConsoleRuntime $ runtime ) use ($ factory ): void {
@@ -35,36 +38,39 @@ public function __construct(
3538 }
3639
3740 public function extract (
41+ StepCodeInterface $ step ,
3842 ExtractorInterface $ extractor ,
39- RejectionInterface $ rejection ,
40- StateInterface $ state ,
43+ StepRejectionInterface $ rejection ,
44+ StepStateInterface $ state ,
4145 ): self {
42- $ this ->queuedCalls [] = static function (PipelineConsoleRuntime $ runtime ) use ($ extractor , $ rejection , $ state ): void {
43- $ runtime ->extract ($ extractor , $ rejection , $ state );
46+ $ this ->queuedCalls [] = static function (PipelineConsoleRuntime $ runtime ) use ($ step , $ extractor , $ rejection , $ state ): void {
47+ $ runtime ->extract ($ step , $ extractor , $ rejection , $ state );
4448 };
4549
4650 return $ this ;
4751 }
4852
4953 public function transform (
54+ StepCodeInterface $ step ,
5055 TransformerInterface $ transformer ,
51- RejectionInterface $ rejection ,
52- StateInterface $ state ,
56+ StepRejectionInterface $ rejection ,
57+ StepStateInterface $ state ,
5358 ): self {
54- $ this ->queuedCalls [] = static function (PipelineConsoleRuntime $ runtime ) use ($ transformer , $ rejection , $ state ): void {
55- $ runtime ->transform ($ transformer , $ rejection , $ state );
59+ $ this ->queuedCalls [] = static function (PipelineConsoleRuntime $ runtime ) use ($ step , $ transformer , $ rejection , $ state ): void {
60+ $ runtime ->transform ($ step , $ transformer , $ rejection , $ state );
5661 };
5762
5863 return $ this ;
5964 }
6065
6166 public function load (
67+ StepCodeInterface $ step ,
6268 LoaderInterface $ loader ,
63- RejectionInterface $ rejection ,
64- StateInterface $ state ,
69+ StepRejectionInterface $ rejection ,
70+ StepStateInterface $ state ,
6571 ): self {
66- $ this ->queuedCalls [] = static function (PipelineConsoleRuntime $ runtime ) use ($ loader , $ rejection , $ state ): void {
67- $ runtime ->load ($ loader , $ rejection , $ state );
72+ $ this ->queuedCalls [] = static function (PipelineConsoleRuntime $ runtime ) use ($ step , $ loader , $ rejection , $ state ): void {
73+ $ runtime ->load ($ step , $ loader , $ rejection , $ state );
6874 };
6975
7076 return $ this ;
@@ -73,7 +79,7 @@ public function load(
7379 public function run (int $ interval = 1000 ): int
7480 {
7581 $ state = $ this ->state ->withPipeline ((string ) $ this ->code );
76- $ pipeline = new Pipeline ($ this ->pipelineRunner , new State \ MemoryState ());
82+ $ pipeline = new Pipeline ($ this ->pipelineRunner , new MemoryState ());
7783
7884 $ runtime = new PipelineConsoleRuntime ($ this ->output , $ pipeline , $ state );
7985
0 commit comments