Total Complexity | 9 |
Total Lines | 56 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | trait CanInitFromConfigTrait |
||
13 | { |
||
14 | protected static $configRoot = null; |
||
15 | |||
16 | /** |
||
17 | * @return static|Config |
||
18 | */ |
||
19 | public static function fromConfig() |
||
20 | { |
||
21 | $config = new static(); |
||
22 | $config->initFromConfig(); |
||
23 | return $config; |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * @return bool |
||
28 | */ |
||
29 | public static function canInitFromConfig(): bool |
||
50 | } |
||
51 | |||
52 | protected function initFromConfig() |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * @param string $value |
||
61 | * @param null $default |
||
62 | * @return mixed|null |
||
63 | */ |
||
64 | protected static function getConfigVar($value, $default = null) |
||
68 | } |
||
69 | } |
||
70 |