Issues (86)

src/Framework/ConfigResolverAwareTrait.php (1 issue)

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
The expression return $this->config could return the type null which is incompatible with the type-hinted return Gacela\Framework\AbstractConfig. Consider adding an additional type-check to rule them out.
Loading history...
20
    }
21
}
22