1 | <?php |
||
13 | class Registry |
||
14 | { |
||
15 | /** |
||
16 | * @var array<Builder> |
||
17 | */ |
||
18 | private $builders = []; |
||
19 | |||
20 | /** |
||
21 | * Register a builder |
||
22 | * |
||
23 | * @param string classname Fully qualified classname of the handled specification |
||
24 | * @param Builder $builder |
||
25 | */ |
||
26 | 1 | public function register($classname, Builder $builder) |
|
30 | |||
31 | /** |
||
32 | * Get registred builder for Specification |
||
33 | * |
||
34 | * @param Specification $spec |
||
35 | * |
||
36 | * @return Builder |
||
37 | * |
||
38 | * @throw OutOfRangeException if builder not found |
||
39 | */ |
||
40 | 2 | public function getBuilder(Specification $spec) |
|
51 | } |
||
52 |