Passed
Pull Request — master (#721)
by Florian
02:33
created

Button   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 54
ccs 8
cts 8
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A render() 0 3 1
1
<?php
2
3
namespace JeroenNoten\LaravelAdminLte\Components;
4
5
use Illuminate\View\Component;
6
7
class Button extends Component
8
{
9
    /**
10
     * The visible label (text) for the button.
11
     *
12
     * @var string
13
     */
14
    public $label;
15
16
    /**
17
     * The button type ('button', 'submit', 'reset'). Similar to the html type
18
     * attribute but with a default value.
19
     *
20
     * @var string
21
     */
22
    public $type;
23
24
    /**
25
     * The button style theme. One of the available AdminLTE theme: primary,
26
     * secondary, info, warning, danger, success, dark, etc.
27
     *
28
     * @var string
29
     */
30
    public $theme;
31
32
    /**
33
     * A fontawesome icon for the button.
34
     *
35
     * @var string
36
     */
37
    public $icon;
38
39
    /**
40
     * Create a new component instance.
41
     *
42
     * @return void
43
     */
44 1
    public function __construct(
45
        $label = null, $type = 'button', $theme = 'default', $icon = null
46
    ) {
47 1
        $this->label = $label;
48 1
        $this->type = $type;
49 1
        $this->theme = $theme;
50 1
        $this->icon = $icon;
51 1
    }
52
53
    /**
54
     * Get the view / contents that represent the component.
55
     *
56
     * @return \Illuminate\View\View|string
57
     */
58 1
    public function render()
59
    {
60 1
        return view('adminlte::components.button');
61
    }
62
}
63