Skip to content

Commit 5ee99bb

Browse files
committed
Changed namespace and added php-etl/console-state into dependencies
1 parent 8949990 commit 5ee99bb

File tree

4 files changed

+66
-12
lines changed

4 files changed

+66
-12
lines changed

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@
1818
"require": {
1919
"php": "^8.0",
2020
"symfony/console": "^5.2",
21-
"php-etl/pipeline-contracts": "^0.3.0"
21+
"php-etl/pipeline-contracts": "^0.3.0",
22+
"php-etl/console-state": "^0.1.0"
2223
},
2324
"autoload": {
2425
"psr-4": {
25-
"Kiboko\\Component\\Runtime\\PipelineConsoleRuntime\\": "src/"
26+
"Kiboko\\Component\\Runtime\\Pipeline\\": "src/"
2627
}
2728
},
2829
"autoload-dev": {
2930
"psr-4": {
30-
"functional\\Kiboko\\Component\\Runtime\\PipelineConsoleRuntime\\": "tests/unit/"
31+
"functional\\Kiboko\\Component\\Runtime\\Pipeline\\": "tests/unit/"
3132
}
3233
},
3334
"config": {

composer.lock

Lines changed: 53 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/PipelineConsoleRuntime.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?php declare(strict_types=1);
22

3-
namespace Kiboko\Component\Runtime\PipelineConsoleRuntime;
3+
namespace Kiboko\Component\Runtime\Pipeline;
44

5+
use Kiboko\Component\State;
56
use Kiboko\Contract\Pipeline\ExtractorInterface;
67
use Kiboko\Contract\Pipeline\TransformerInterface;
78
use Kiboko\Contract\Pipeline\LoaderInterface;
@@ -12,22 +13,22 @@
1213

1314
final class PipelineConsoleRuntime implements PipelineRuntimeInterface
1415
{
15-
private StateOutput\Pipeline $state;
16+
private State\StateOutput\Pipeline $state;
1617

1718
public function __construct(
1819
ConsoleOutput $output,
1920
private PipelineInterface $pipeline,
20-
?StateOutput\Pipeline $state = null
21+
?State\StateOutput\Pipeline $state = null
2122
) {
22-
$this->state = $state ?? new StateOutput\Pipeline($output, 'A', 'Pipeline');
23+
$this->state = $state ?? new State\StateOutput\Pipeline($output, 'A', 'Pipeline');
2324
}
2425

2526
public function extract(
2627
ExtractorInterface $extractor,
2728
RejectionInterface $rejection,
2829
StateInterface $state,
2930
): self {
30-
$this->pipeline->extract($extractor, $rejection, $state = new MemoryState($state));
31+
$this->pipeline->extract($extractor, $rejection, $state = new State\MemoryState($state));
3132

3233
$this->state->withStep('extractor')
3334
->addMetric('read', $state->observeAccept())
@@ -42,7 +43,7 @@ public function transform(
4243
RejectionInterface $rejection,
4344
StateInterface $state,
4445
): self {
45-
$this->pipeline->transform($transformer, $rejection, $state = new MemoryState($state));
46+
$this->pipeline->transform($transformer, $rejection, $state = new State\MemoryState($state));
4647

4748
$this->state->withStep('transformer')
4849
->addMetric('read', $state->observeAccept())
@@ -57,7 +58,7 @@ public function load(
5758
RejectionInterface $rejection,
5859
StateInterface $state,
5960
): self {
60-
$this->pipeline->load($loader, $rejection, $state = new MemoryState($state));
61+
$this->pipeline->load($loader, $rejection, $state = new State\MemoryState($state));
6162

6263
$this->state->withStep('loader')
6364
->addMetric('read', $state->observeAccept())

src/PipelineRuntimeInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types=1);
22

3-
namespace Kiboko\Component\Runtime\PipelineConsoleRuntime;
3+
namespace Kiboko\Component\Runtime\Pipeline;
44

55
use Kiboko\Contract\Pipeline\ExtractingInterface;
66
use Kiboko\Contract\Pipeline\LoadingInterface;

0 commit comments

Comments
 (0)