Total Complexity | 5 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
11 | trait HasCommandsCollection |
||
12 | { |
||
13 | protected $commandsCollection = null; |
||
14 | |||
15 | /** |
||
16 | * @return mixed |
||
17 | */ |
||
18 | 3 | public function getCommandsCollection() |
|
19 | { |
||
20 | 3 | if ($this->commandsCollection === null) { |
|
21 | 3 | $this->initCommandsCollection(); |
|
22 | } |
||
23 | 3 | return $this->commandsCollection; |
|
24 | } |
||
25 | |||
26 | /** |
||
27 | * @param mixed $commandsCollection |
||
28 | */ |
||
29 | 3 | public function setCommandsCollection($commandsCollection) |
|
32 | 3 | } |
|
33 | |||
34 | 3 | protected function initCommandsCollection() |
|
35 | { |
||
36 | 3 | $this->setCommandsCollection($this->newCommandsCollection()); |
|
37 | 3 | } |
|
38 | |||
39 | /** |
||
40 | * @return CommandsCollection |
||
41 | */ |
||
42 | 3 | protected function newCommandsCollection() |
|
45 | } |
||
46 | } |
||
47 |