Completed
Branch master (afd3db)
by Yaro
01:50
created

ShowHideColumnsTool   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 1
dl 0
loc 45
ccs 11
cts 11
cp 1
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A identifier() 0 4 1
A position() 0 4 1
A render() 0 6 1
A handle() 0 4 1
A check() 0 4 1
1
<?php
2
3
namespace Yaro\Jarboe\Table\Toolbar;
4
5
use Illuminate\Http\Request;
6
7
class ShowHideColumnsTool extends AbstractTool
8
{
9
    /**
10
     * Position where should tool be placed.
11
     */
12 1
    public function position()
13
    {
14 1
        return self::POSITION_HEADER;
15
    }
16
17
    /**
18
     * Unique tool identifier.
19
     */
20 4
    public function identifier(): string
21
    {
22 4
        return 'show_hide_columns';
23
    }
24
25
    /**
26
     * Tool's view.
27
     */
28 1
    public function render()
29
    {
30 1
        return view('jarboe::crud.toolbar.show_hide_columns', [
31 1
            'tool' => $this,
32
        ]);
33
    }
34
35
    /**
36
     * Handle tool execution.
37
     * @param Request $request
38
     */
39 1
    public function handle(Request $request)
40
    {
41
        // dummy
42 1
    }
43
44
    /**
45
     * Check allowance to show and process tool.
46
     */
47 1
    public function check(): bool
48
    {
49 1
        return true;
50
    }
51
}
52