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

Checkboxes   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Importance

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

2 Methods

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