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

Checkboxes   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 59
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 5 1
A __construct() 0 45 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
        $renderForBlocks = false,
16
        $renderForModal = false,
17
        $options = [],
18
        $unpack = false,
19
        $columns = 0,
20
        $searchable = false,
21
        $note = null,
22
        $placeholder = null,
23
        $disabled = false,
24
        $addNew = false,
25
        $moduleName = null,
26
        $storeUrl = null,
27
        $fieldsInModal = false,
28
        $default = false,
29
        $min = null,
30
        $max = null,
31
        $inline = false,
32
        $border = false
33
    ) {
34
        parent::__construct(
35
            $name,
36
            $label,
37
            $renderForBlocks,
38
            $renderForModal,
39
            $options,
40
            $unpack,
41
            $columns,
42
            $searchable,
43
            $note,
44
            $placeholder,
45
            $disabled,
46
            $addNew,
47
            $moduleName,
48
            $storeUrl,
49
            $default,
50
            $fieldsInModal
51
        );
52
53
        $this->inline = $inline;
54
        $this->border = $border;
55
        $this->min = $min;
56
        $this->max = $max;
57
    }
58
59
    public function render()
60
    {
61
        return view('twill::partials.form._checkboxes', [
62
            'options' => $this->options,
63
            'inModal' => $this->isInModal()
64
        ]);
65
    }
66
}
67