1 | <?php |
||
31 | class Configuration |
||
32 | { |
||
33 | /** |
||
34 | * @var array<Module> Instantiated modules |
||
35 | */ |
||
36 | protected $modules; |
||
37 | /** |
||
38 | * @var Properties The config container |
||
39 | */ |
||
40 | protected $config; |
||
41 | |||
42 | /** |
||
43 | * Creates a new Configuration. |
||
44 | * |
||
45 | * This constructor expects an array full of class names in the `$modules` |
||
46 | * parameter. Each class name *must* extend `Caridea\Module\Module` or an |
||
47 | * `UnexpectedValueException` will be thrown. |
||
48 | * |
||
49 | * @param array<string> $modules An array of module class names |
||
50 | * @param array<string,mixed> $config The system configuration |
||
51 | * @throws \UnexpectedValueException if a module class doesn't extend `Caridea\Module\Module` |
||
52 | */ |
||
53 | 2 | public function __construct(array $modules, array $config) |
|
58 | |||
59 | 2 | private function createModules(array $sysModules) |
|
71 | |||
72 | 1 | private function createConfigContainer(array $config): Properties |
|
83 | |||
84 | /** |
||
85 | * Gets the configuration settings container. |
||
86 | * |
||
87 | * @return \Caridea\Container\Properties The config container |
||
88 | */ |
||
89 | 1 | public function getConfigContainer(): Properties |
|
93 | |||
94 | /** |
||
95 | * Gets the loaded modules. |
||
96 | * |
||
97 | * @return array<\Caridea\Module\Module> The loaded modules |
||
98 | */ |
||
99 | 1 | public function getModules(): array |
|
103 | } |
||
104 |