diff --git a/src/Builder/BuilderRegistry.php b/src/Builder/BuilderRegistry.php index cf1449c..13b9c96 100644 --- a/src/Builder/BuilderRegistry.php +++ b/src/Builder/BuilderRegistry.php @@ -9,7 +9,12 @@ final class BuilderRegistry implements BuilderRegistryInterface /** @var array */ private array $builders = []; - public function getBuilder(string $name): BuilderInterface + public function set(string $name, BuilderInterface $builder): void + { + $this->builders[$name] = $builder; + } + + public function get(string $name): BuilderInterface { if (!isset($this->builders[$name])) { throw new \Exception(sprintf('Builder with name "%s" not available from registry', $name)); @@ -17,9 +22,4 @@ public function getBuilder(string $name): BuilderInterface return $this->builders[$name]; } - - public function addBuilder(string $name, BuilderInterface $builder): void - { - $this->builders[$name] = $builder; - } } diff --git a/src/Builder/BuilderRegistryInterface.php b/src/Builder/BuilderRegistryInterface.php index 048d649..0d9fb37 100644 --- a/src/Builder/BuilderRegistryInterface.php +++ b/src/Builder/BuilderRegistryInterface.php @@ -6,7 +6,7 @@ interface BuilderRegistryInterface { - public function getBuilder(string $name): BuilderInterface; + public function set(string $name, BuilderInterface $builder): void; - public function addBuilder(string $name, BuilderInterface $builder): void; + public function get(string $name): BuilderInterface; }