Skip to content

Commit

Permalink
Merge pull request #2 from KaririCode-Framework/develop
Browse files Browse the repository at this point in the history
feat: integrate ProcessorRegistry interface into ProcessorBuilder
  • Loading branch information
walmir-silva authored Oct 13, 2024
2 parents 0ab71d9 + 91cba79 commit 94926b2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
14 changes: 7 additions & 7 deletions composer.lock

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

1 change: 1 addition & 0 deletions src/ProcessorBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use KaririCode\Contract\Processor\ConfigurableProcessor;
use KaririCode\Contract\Processor\Pipeline;
use KaririCode\Contract\Processor\Processor;
use KaririCode\Contract\Processor\ProcessorRegistry;

class ProcessorBuilder
{
Expand Down
8 changes: 5 additions & 3 deletions src/ProcessorRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@

namespace KaririCode\ProcessorPipeline;

use KaririCode\Contract\DataStructure\Map;
use KaririCode\Contract\Processor\Processor;
use KaririCode\Contract\Processor\ProcessorRegistry as ProcessorRegistryContract;
use KaririCode\DataStructure\Map\HashMap;

class ProcessorRegistry
class ProcessorRegistry implements ProcessorRegistryContract
{
public function __construct(private HashMap $processors = new HashMap())
public function __construct(private Map $processors = new HashMap())
{
}

Expand All @@ -35,7 +37,7 @@ public function get(string $context, string $name): Processor
return $contextMap->get($name);
}

public function getContextProcessors(string $context): HashMap
public function getContextProcessors(string $context): Map
{
if (!$this->processors->containsKey($context)) {
throw new \RuntimeException("Context '$context' not found.");
Expand Down

0 comments on commit 94926b2

Please sign in to comment.