1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace Gacela\Framework; |
||
6 | |||
7 | use Gacela\Framework\ClassResolver\Config\ConfigResolver; |
||
8 | |||
9 | trait ConfigResolverAwareTrait |
||
10 | { |
||
11 | private ?AbstractConfig $config = null; |
||
12 | |||
13 | 33 | public function getConfig(): AbstractConfig |
|
14 | { |
||
15 | 33 | if ($this->config === null) { |
|
16 | 24 | $this->config = (new ConfigResolver())->resolve($this); |
|
17 | } |
||
18 | |||
19 | 33 | return $this->config; |
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
20 | } |
||
21 | } |
||
22 |