ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ConfigCollection.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Setup;
22
26class ConfigCollection implements Config
27{
31 protected array $configs;
32
33 public function __construct(array $configs)
34 {
35 $this->configs = $configs;
36 }
37
38 public function getConfig(string $key): Config
39 {
40 if (!isset($this->configs[$key])) {
41 throw new \InvalidArgumentException(
42 "Unknown key '$key' for Config."
43 );
44 }
45 return $this->configs[$key];
46 }
47
48 public function maybeGetConfig(string $key): ?Config
49 {
50 return $this->configs[$key] ?? null;
51 }
52
56 public function getKeys(): array
57 {
58 return array_keys($this->configs);
59 }
60}
A collection of some configurations.
A configuration for the setup.
Definition: Config.php:27
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...