| Total Complexity | 8 |
| Total Lines | 60 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class DICParams |
||
| 8 | { |
||
| 9 | private static $params = []; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * DICParams constructor. |
||
| 13 | * |
||
| 14 | * @param array $params |
||
| 15 | */ |
||
| 16 | private function __construct(array $params = []) |
||
| 20 | } |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @param string $filename |
||
| 25 | * |
||
| 26 | * @return DICParams |
||
| 27 | * @throws \Exception |
||
| 28 | */ |
||
| 29 | public static function initFromFile($filename) |
||
| 30 | { |
||
| 31 | return new self(Parser::parse($filename)); |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @param string $key |
||
| 36 | * |
||
| 37 | * @return mixed|null |
||
| 38 | */ |
||
| 39 | public static function get($key) |
||
| 40 | { |
||
| 41 | if (self::has($key)) { |
||
| 42 | return self::$params[$key]; |
||
| 43 | } |
||
| 44 | |||
| 45 | return null; |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @param string $key |
||
| 50 | * @param string $value |
||
| 51 | */ |
||
| 52 | public static function set($key, $value) |
||
| 56 | } |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @param string $key |
||
| 61 | * |
||
| 62 | * @return bool |
||
| 63 | */ |
||
| 64 | public static function has($key) |
||
| 69 |