1 | <?php |
||
26 | final class Loader implements LoaderInterface |
||
27 | { |
||
28 | /** |
||
29 | * @var array |
||
30 | */ |
||
31 | private static $types = [ |
||
32 | 'yml' => 'yaml', |
||
33 | 'yaml' => 'yaml', |
||
34 | 'json' => 'json', |
||
35 | 'fbp' => 'fbp', |
||
36 | ]; |
||
37 | |||
38 | /** |
||
39 | 7 | * @param string $file name/path of file to load |
|
40 | * @return DefinitionInterface |
||
41 | 7 | * @throws LoaderException |
|
42 | 6 | */ |
|
43 | public static function load(string $file) : DefinitionInterface |
||
73 | |||
74 | /** |
||
75 | * Check file if extension matches a loader. |
||
76 | 7 | * |
|
77 | * @param string $file |
||
78 | 7 | * @return string |
|
79 | 7 | * @throws LoaderException |
|
80 | */ |
||
81 | 7 | private static function checkType(string $file) : string |
|
92 | 6 | ||
93 | /** |
||
94 | 6 | * @param string $file |
|
95 | 4 | * @return string |
|
96 | 4 | * @throws LoaderException |
|
97 | 2 | */ |
|
98 | 2 | private static function loadFile(string $file) : string |
|
110 | } |
||
111 |