Passed
Pull Request — 2.x (#1360)
by Harings
09:37
created

Radios   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 41 1
A render() 0 5 1
1
<?php
2
3
namespace A17\Twill\View\Components;
4
5
class Radios extends FieldWithOptions
6
{
7
    public $inline;
8
    public $border;
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 = false,
25
        $inline = false,
26
        $border = false,
27
        $renderForBlocks = false,
28
        $renderForModal = false
29
    ) {
30
        parent::__construct(
31
            $name,
32
            $label,
33
            $renderForBlocks,
34
            $renderForModal,
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
    }
52
53
    public function render()
54
    {
55
        return view('twill::partials.form._radios', [
56
            'options' => $this->getOptions(),
57
            'inModal' => $this->isInModal()
58
        ]);
59
    }
60
}
61