Conditions | 2 |
Paths | 2 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | public static function loadConfigs(): array |
||
16 | { |
||
17 | $configDirectories = [ |
||
18 | __DIR__ . '/../../../config', |
||
19 | __DIR__ . '/../../../../../', |
||
20 | __DIR__ . '/../../../../../config', |
||
21 | ]; |
||
22 | |||
23 | $fileLocator = new FileLocator($configDirectories); |
||
24 | $fileName = $fileLocator->locate('sr_config.yaml'); |
||
25 | |||
26 | if ($fileName === null) { |
||
|
|||
27 | throw ConfigNotFoundException::configFileNotFound($configDirectories); |
||
28 | } |
||
29 | |||
30 | return (new Processor()) |
||
31 | ->processConfiguration(new RbacConfigStructure(), Yaml::parseFile($fileName)); |
||
32 | } |
||
34 | } |