Total Complexity | 5 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | trait HasInstantiatorTrait |
||
10 | { |
||
11 | protected $instantiator = null; |
||
12 | |||
13 | /** |
||
14 | * @return Instantiator |
||
15 | */ |
||
16 | 3 | public function getInstantiator() |
|
17 | { |
||
18 | 3 | if ($this->instantiator === null) { |
|
19 | 1 | $this->setInstantiator($this->generateInstantiator()); |
|
20 | } |
||
21 | 3 | return $this->instantiator; |
|
22 | } |
||
23 | |||
24 | /** |
||
25 | * @param Instantiator $instantiator |
||
26 | */ |
||
27 | 3 | public function setInstantiator($instantiator): void |
|
30 | 3 | } |
|
31 | |||
32 | /** |
||
33 | * @return Instantiator |
||
34 | */ |
||
35 | 1 | protected function generateInstantiator() |
|
42 | } |
||
43 | } |