ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ConfigCollection.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 2019 Richard Klees <richard.klees@concepts-and-training.de> Extended GPL, see docs/LICENSE */
4
5namespace ILIAS\Setup;
6
10class ConfigCollection implements Config
11{
15 protected $configs;
16
17 public function __construct(array $configs)
18 {
19 $this->configs = $configs;
20 }
21
22 public function getConfig(string $key) : Config
23 {
24 if (!isset($this->configs[$key])) {
25 throw new \InvalidArgumentException(
26 "Unknown key '$key' for Config."
27 );
28 }
29 return $this->configs[$key];
30 }
31
35 public function getKeys() : array
36 {
37 return array_keys($this->configs);
38 }
39}
An exception for terminatinating execution or to throw for unit testing.
A collection of some configurations.
A configuration for the setup.
Definition: Config.php:11