| Total Complexity | 3 |
| Total Lines | 32 |
| Duplicated Lines | 0 % |
| Coverage | 85.71% |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | trait CanHide |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var Closure |
||
| 11 | */ |
||
| 12 | protected ?Closure $hideWhen = null; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Set hide condition for current menu item. |
||
| 16 | * |
||
| 17 | * @param Closure |
||
| 18 | * @return self |
||
| 19 | */ |
||
| 20 | 2 | public function hideWhen(Closure $callback): self |
|
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Determine whether the menu item is hidden. |
||
| 29 | * |
||
| 30 | * @return boolean |
||
| 31 | */ |
||
| 32 | 2 | public function hidden(): bool |
|
| 41 |