| Total Complexity | 5 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 7 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 5 | trait SlotRenderer |
||
| 6 | { |
||
| 7 | protected $slotName; |
||
| 8 | |||
| 9 | protected $slots = []; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * Start output buffer to get content of slot and set slot name. |
||
| 13 | * |
||
| 14 | * @param string $name |
||
| 15 | */ |
||
| 16 | 5 | public function startSlot($name) |
|
| 20 | } |
||
| 21 | 5 | } |
|
| 22 | |||
| 23 | /** |
||
| 24 | * get slot content from widget block. |
||
| 25 | * |
||
| 26 | * @param string $data |
||
| 27 | */ |
||
| 28 | 5 | public function renderSlot($data = '') |
|
| 31 | 5 | } |
|
| 32 | |||
| 33 | /** |
||
| 34 | * check if widget has any slots. |
||
| 35 | * |
||
| 36 | * @return bool |
||
| 37 | */ |
||
| 38 | 21 | public function hasSlots() |
|
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * get and clean current slots. |
||
| 45 | * |
||
| 46 | * @return array $slots |
||
| 47 | */ |
||
| 48 | 4 | public function getSlots() |
|
| 57 |