Skip to content

Commit

Permalink
change state usage
Browse files Browse the repository at this point in the history
  • Loading branch information
programgames committed Oct 19, 2021
1 parent 023fa8d commit 6b71a71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 2 additions & 7 deletions src/HookRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ public function load(
return $this;
}

public function run(): int
public function run(): array
{
$line = 0;
foreach ($this->pipeline->walk() as $item) {
$line++;
}

return $line;
return $this->state->getMetrics();
}

public function feed(...$data): HookRuntimeInterface
Expand All @@ -67,9 +67,4 @@ public function container(): ContainerInterface
{
return $this->container;
}

public function metrics(): array
{
return $this->state->getMetrics();
}
}
4 changes: 2 additions & 2 deletions src/HookRuntimeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
use Kiboko\Contract\Pipeline\TransformingInterface;
use Psr\Container\ContainerInterface;

interface HookRuntimeInterface extends TransformingInterface, LoadingInterface, RunnableInterface
interface HookRuntimeInterface extends TransformingInterface, LoadingInterface
{
public function feed(...$data): self;
public function container(): ContainerInterface;
public function metrics(): array;
public function run(): array;
}

0 comments on commit 6b71a71

Please sign in to comment.