| Total Complexity | 3 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Coverage | 75% |
| Changes | 2 | ||
| Bugs | 1 | 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 | } |
||
| 41 |