Passed
Pull Request — 2.x (#1360)
by Harings
11:27
created

MultiSelect   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 23
c 1
b 0
f 0
dl 0
loc 48
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 5 1
A __construct() 0 36 1
1
<?php
2
3
namespace A17\Twill\View\Components;
4
5
class MultiSelect extends FieldWithOptions
6
{
7
    public $min;
8
    public $max;
9
10
    public function __construct(
11
        $name,
12
        $label,
13
        $options = [],
14
        $unpack = false,
15
        $columns = 0,
16
        $searchable = false,
17
        $note = null,
18
        $placeholder = null,
19
        $disabled = false,
20
        $addNew = false,
21
        $moduleName = null,
22
        $default = false,
23
        $storeUrl = null,
24
        $fieldsInModal = null,
25
        $min = null,
26
        $max = null
27
    ) {
28
        parent::__construct(
29
            $name,
30
            $label,
31
            $options,
32
            $unpack,
33
            $columns,
34
            $searchable,
35
            $note,
36
            $placeholder,
37
            $disabled,
38
            $addNew,
39
            $moduleName,
40
            $storeUrl,
41
            $default,
42
            $fieldsInModal
43
        );
44
        $this->min = $min;
45
        $this->max = $max;
46
    }
47
48
    public function render()
49
    {
50
        return view('twill::partials.form._multi_select', [
51
            'options' => $this->getOptions(),
52
            'inModal' => $this->inModal()
53
        ]);
54
    }
55
}
56