Passed
Pull Request — master (#856)
by Florian
03:57
created

Select   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
dl 0
loc 42
ccs 11
cts 11
cp 1
rs 10
c 1
b 0
f 0
wmc 5

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A render() 0 3 1
A makeItemClass() 0 9 3
1
<?php
2
3
namespace JeroenNoten\LaravelAdminLte\Components;
4
5
class Select extends InputGroupComponent
6
{
7
    /**
8
     * Create a new component instance.
9
     *
10
     * @return void
11
     */
12 2
    public function __construct(
13
        $name, $label = null, $size = null, $labelClass = null,
14
        $topClass = null, $inputGroupClass = null, $disableFeedback = null
15
    ) {
16 2
        parent::__construct(
17 2
            $name, $label, $size, $labelClass, $topClass,
18
            $inputGroupClass, $disableFeedback
19
        );
20 2
    }
21
22
    /**
23
     * Make the class attribute for the input group item.
24
     *
25
     * @param string $invalid
26
     * @return string
27
     */
28 1
    public function makeItemClass($invalid = null)
29
    {
30 1
        $classes = ['form-control'];
31
32 1
        if (! empty($invalid) && ! isset($this->disableFeedback)) {
33 1
            $classes[] = 'is-invalid';
34
        }
35
36 1
        return implode(' ', $classes);
37
    }
38
39
    /**
40
     * Get the view / contents that represent the component.
41
     *
42
     * @return \Illuminate\View\View|string
43
     */
44 1
    public function render()
45
    {
46 1
        return view('adminlte::components.select');
47
    }
48
}
49