Conditions | 3 |
Paths | 3 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php namespace Xaoc303\BattleCalc; |
||
5 | public static function get($key, $default = null) |
||
6 | { |
||
7 | if (empty($key)) { |
||
8 | return $default; |
||
9 | } |
||
10 | |||
11 | $key = str_replace("battle-calc::", "", $key); |
||
12 | $keys = explode('.', $key); |
||
13 | |||
14 | $pathToDirConfigs = self::getPathToDirConfigs(); |
||
15 | $fullPathToFileConfig = self::getPathToFileConfig($pathToDirConfigs, $keys); |
||
16 | |||
17 | if (!file_exists( $fullPathToFileConfig )) { |
||
18 | return $default; |
||
19 | } |
||
20 | |||
21 | return self::getArrayFromFile($fullPathToFileConfig, $keys); |
||
22 | } |
||
23 | |||
49 | } |