1 | <?php |
||
5 | class LoaderFactory |
||
6 | { |
||
7 | /** |
||
8 | * @var array |
||
9 | */ |
||
10 | private $loaders = [ |
||
11 | 'php' => PhpLoader::class, |
||
12 | 'yaml' => YamlLoader::class, |
||
13 | ]; |
||
14 | |||
15 | /** |
||
16 | * @var LoaderInterface[] |
||
17 | */ |
||
18 | private $instances = []; |
||
19 | |||
20 | /** |
||
21 | * @param array $loaders |
||
22 | */ |
||
23 | 8 | public function __construct(array $loaders = []) |
|
27 | |||
28 | /** |
||
29 | * @param string $extension |
||
30 | * @return LoaderInterface |
||
31 | */ |
||
32 | 8 | public function forType($extension) |
|
40 | |||
41 | /** |
||
42 | * @param string $loader |
||
43 | * @return LoaderInterface |
||
44 | * @throws LoaderException |
||
45 | * If the requested loader cannot be created. |
||
46 | */ |
||
47 | 8 | private function make($loader) |
|
59 | } |
||
60 |