| 1 | <?php |
||
| 8 | class ConverterManager |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var array |
||
| 12 | */ |
||
| 13 | private $converters = []; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Get registered converters |
||
| 17 | * |
||
| 18 | * @return ConverterInterface[] |
||
| 19 | */ |
||
| 20 | 4 | public function getConverters() |
|
| 24 | |||
| 25 | /** |
||
| 26 | * Register a converter |
||
| 27 | * |
||
| 28 | * @param string $name |
||
| 29 | * @param ConverterInterface $converter |
||
| 30 | */ |
||
| 31 | 4 | public function addConverter($name, ConverterInterface $converter) |
|
| 35 | |||
| 36 | /** |
||
| 37 | * Get the converter |
||
| 38 | * |
||
| 39 | * @param string $name |
||
| 40 | * |
||
| 41 | * @return ConverterInterface |
||
| 42 | */ |
||
| 43 | 4 | public function getConverter($name) |
|
| 51 | } |
||
| 52 |