1 | <?php |
||
9 | class Loader implements LoaderContract |
||
10 | { |
||
11 | /** |
||
12 | * The Config Manager. |
||
13 | * |
||
14 | * @var ManagerContract |
||
15 | */ |
||
16 | protected $config; |
||
17 | |||
18 | /** |
||
19 | * The available config parsers. |
||
20 | * |
||
21 | * @var ParserContract[] |
||
22 | */ |
||
23 | protected $parsers; |
||
24 | |||
25 | /** |
||
26 | * Construct a new Config Loader with the Config to load in to |
||
27 | * being passed as a constructor dependency. |
||
28 | * |
||
29 | * @param Manager $config |
||
30 | * |
||
31 | * @author Glenn McEwan <[email protected]> |
||
32 | */ |
||
33 | 2 | public function __construct(ManagerContract $config) |
|
37 | |||
38 | /** |
||
39 | * {@inheritdoc} |
||
40 | * |
||
41 | * @param ParserContract $parser |
||
42 | * @param string $key |
||
43 | * |
||
44 | * @return ParserContract |
||
45 | * |
||
46 | * @author Glenn McEwan <[email protected]> |
||
47 | */ |
||
48 | 2 | public function registerParser(ParserContract $parser, $key = null) |
|
56 | |||
57 | /** |
||
58 | * {@inheritdoc} |
||
59 | * |
||
60 | * @param string $key Parser Key |
||
61 | * |
||
62 | * @return ParserContract |
||
63 | * |
||
64 | * @author Glenn McEwan <[email protected]> |
||
65 | */ |
||
66 | 2 | public function getParser($key) |
|
74 | } |
||
75 |