ILIAS  release_7 Revision v7.30-3-g800a261c036
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
32 public function maybeGetConfig(string $key) : ?Config
33 {
34 return $this->configs[$key] ?? null;
35 }
36
40 public function getKeys() : array
41 {
42 return array_keys($this->configs);
43 }
44}
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...