File tree 2 files changed +8
-8
lines changed
2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -9,17 +9,17 @@ final class BuilderRegistry implements BuilderRegistryInterface
9
9
/** @var array<BuilderInterface> */
10
10
private array $ builders = [];
11
11
12
- public function getBuilder (string $ name ): BuilderInterface
12
+ public function set (string $ name , BuilderInterface $ builder ): void
13
+ {
14
+ $ this ->builders [$ name ] = $ builder ;
15
+ }
16
+
17
+ public function get (string $ name ): BuilderInterface
13
18
{
14
19
if (!isset ($ this ->builders [$ name ])) {
15
20
throw new \Exception (sprintf ('Builder with name "%s" not available from registry ' , $ name ));
16
21
}
17
22
18
23
return $ this ->builders [$ name ];
19
24
}
20
-
21
- public function addBuilder (string $ name , BuilderInterface $ builder ): void
22
- {
23
- $ this ->builders [$ name ] = $ builder ;
24
- }
25
25
}
Original file line number Diff line number Diff line change 6
6
7
7
interface BuilderRegistryInterface
8
8
{
9
- public function getBuilder (string $ name ): BuilderInterface ;
9
+ public function set (string $ name, BuilderInterface $ builder ): void ;
10
10
11
- public function addBuilder (string $ name, BuilderInterface $ builder ): void ;
11
+ public function get (string $ name ): BuilderInterface ;
12
12
}
You can’t perform that action at this time.
0 commit comments