Total Complexity | 4 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | trait ConfigResolverAwareTrait |
||
11 | { |
||
12 | private ?AbstractConfig $config = null; |
||
13 | |||
14 | /** |
||
15 | * Syntax sugar to access the config from static methods. |
||
16 | */ |
||
17 | public static function config(): AbstractConfig |
||
20 | } |
||
21 | |||
22 | public function getConfig(): AbstractConfig |
||
23 | { |
||
24 | if ($this->config === null) { |
||
25 | $this->config = $this->resolveConfig(); |
||
26 | } |
||
27 | |||
28 | return $this->config; |
||
|
|||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @throws ConfigNotFoundException |
||
33 | */ |
||
34 | private function resolveConfig(): AbstractConfig |
||
37 | } |
||
38 | } |
||
39 |