Passed
Push — master ( 5cded9...9f728c )
by Diego
02:41
created

Select::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 9
dl 0
loc 8
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0

How to fix   Many Parameters   

Many Parameters

Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.

There are several approaches to avoid long parameter lists:

1
<?php
2
3
namespace JeroenNoten\LaravelAdminLte\Components\Form;
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, $id = null, $label = null, $igroupSize = null, $labelClass = null,
14
        $fgroupClass = null, $igroupClass = null, $disableFeedback = null,
15
        $errorKey = null
16
    ) {
17 2
        parent::__construct(
18 2
            $name, $id, $label, $igroupSize, $labelClass, $fgroupClass,
19
            $igroupClass, $disableFeedback, $errorKey
20
        );
21 2
    }
22
23
    /**
24
     * Get the view / contents that represent the component.
25
     *
26
     * @return \Illuminate\View\View|string
27
     */
28 1
    public function render()
29
    {
30 1
        return view('adminlte::components.form.select');
31
    }
32
}
33