Total Complexity | 3 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Coverage | 75% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
10 | trait IsLazyLoadedTrait |
||
11 | { |
||
12 | /** @var bool */ |
||
13 | protected $loaded = false; |
||
14 | |||
15 | /** |
||
16 | * Is the lazy collection already initialized? |
||
17 | */ |
||
18 | public function isLoaded() : bool |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * Initialize the collection |
||
25 | */ |
||
26 | 2 | protected function load() : void |
|
34 | 2 | } |
|
35 | |||
36 | /** |
||
37 | * Do the initialization logic |
||
38 | */ |
||
39 | abstract protected function doLoad() : void; |
||
40 | } |