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

InputColor::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 3
c 1
b 0
f 0
nc 2
nop 7
dl 0
loc 9
ccs 4
cts 4
cp 1
crap 2
rs 10
1
<?php
2
3
namespace JeroenNoten\LaravelAdminLte\Components;
4
5
class InputColor extends InputGroupComponent
6
{
7
    /**
8
     * The Bootstrap Colorpicker plugin configuration parameters. Array with
9
     * key => value pairs, where the key should be an existing configuration
10
     * property of the plugin.
11
     *
12
     * @var array
13
     */
14
    public $config;
15
16
    /**
17
     * Create a new component instance.
18
     * Note this component requires the 'Bootstrap Colorpicker' plugin.
19
     *
20
     * @return void
21
     */
22 1
    public function __construct(
23
        $name, $label = null, $size = null, $labelClass = null,
24
        $topClass = null, $disableFeedback = null, $config = []
25
    ) {
26 1
        parent::__construct(
27 1
            $name, $label, $size, $labelClass, $topClass, $disableFeedback
28
        );
29
30 1
        $this->config = is_array($config) ? $config : [];
31 1
    }
32
33
    /**
34
     * Get the view / contents that represent the component.
35
     *
36
     * @return \Illuminate\View\View|string
37
     */
38 1
    public function render()
39
    {
40 1
        return view('adminlte::components.input-color');
41
    }
42
}
43