Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 3 |
ConfigTrait | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 3 |
config | |
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 3 |
<?php | |
namespace ClassConfig\Traits; | |
use ClassConfig\AbstractConfig; | |
use ClassConfig\ClassConfig; | |
/** | |
* Trait ConfigTrait | |
* @package ClassConfig\Traits | |
*/ | |
trait ConfigTrait | |
{ | |
/** | |
* @var AbstractConfig | |
*/ | |
protected $__config__; | |
/** | |
* @return AbstractConfig | |
* @throws \Doctrine\Common\Annotations\AnnotationException | |
* @throws \ReflectionException | |
*/ | |
public function config(): AbstractConfig | |
{ | |
if (!isset($this->__config__)) { | |
$this->__config__ = ClassConfig::createInstance(get_class($this), $this); | |
} | |
return $this->__config__; | |
} | |
} |