Menuable::hideMenu()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
namespace ThinkOne\NovaLaravelFilemanager\Traits;
4
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
52
    {
53 1
        $this->displayImages = true;
54 1
        $this->displayFiles  = false;
55
56 1
        return $this;
57
    }
58
}
59