| Total Complexity | 6 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | trait Menuable |
||
| 6 | { |
||
| 7 | protected string $title = ''; |
||
| 8 | protected string $icon = 'document-search'; |
||
| 9 | protected bool $hideMenu = false; |
||
| 10 | protected string $lfmUrl = '/filemanager'; |
||
| 11 | |||
| 12 | protected bool $displayImages = true; |
||
| 13 | protected bool $displayFiles = true; |
||
| 14 | |||
| 15 | 1 | public function title(string $title): static |
|
| 16 | { |
||
| 17 | 1 | $this->title = $title; |
|
| 18 | |||
| 19 | 1 | return $this; |
|
| 20 | } |
||
| 21 | |||
| 22 | 1 | public function icon(string $icon): static |
|
| 23 | { |
||
| 24 | 1 | $this->icon = $icon; |
|
| 25 | |||
| 26 | 1 | return $this; |
|
| 27 | } |
||
| 28 | |||
| 29 | 1 | public function hideMenu(bool $hide = true): static |
|
| 30 | { |
||
| 31 | 1 | $this->hideMenu = $hide; |
|
| 32 | |||
| 33 | 1 | return $this; |
|
| 34 | } |
||
| 35 | |||
| 36 | 1 | public function lfmUrl(string $lfmUrl): static |
|
| 37 | { |
||
| 38 | 1 | $this->lfmUrl = $lfmUrl; |
|
| 39 | |||
| 40 | 1 | return $this; |
|
| 41 | } |
||
| 42 | |||
| 43 | 1 | public function onlyFiles(): static |
|
| 44 | { |
||
| 45 | 1 | $this->displayImages = false; |
|
| 46 | 1 | $this->displayFiles = true; |
|
| 47 | |||
| 48 | 1 | return $this; |
|
| 49 | } |
||
| 50 | |||
| 51 | 1 | public function onlyImages(): static |
|
| 57 | } |
||
| 58 | } |
||
| 59 |