Passed
Pull Request — master (#962)
by
unknown
06:25
created

Options::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 5
ccs 0
cts 4
cp 0
crap 2
rs 10
1
<?php
2
3
namespace JeroenNoten\LaravelAdminLte\Components\Form;
4
5
use Illuminate\Support\Arr;
6
use Illuminate\View\Component;
7
8
class Options extends Component
9
{
10
    /**
11
     * The list of options as key value pairs
12
     *
13
     * @var array
14
     */
15
    public $options;
16
17
    /**
18
     * The list of selected option keys
19
     *
20
     * @var array
21
     */
22
    public $selected;
23
24
    /**
25
     * Whether to use strict comparison between key and selections
26
     *
27
     * @var bool
28
     */
29
    public $strict;
30
31
    /**
32
     * Create a new component instance.
33
     */
34
    public function __construct($options = null, $selected = null, $strict = null)
35
    {
36
        $this->options = Arr::wrap($options);
37
        $this->selected = Arr::wrap($selected);
38
        $this->strict = isset($strict);
39
    }
40
41
    /**
42
     * Get the view / contents that represent the component.
43
     *
44
     * @return \Illuminate\View\View|string
45
     */
46
    public function render()
47
    {
48
        return view('adminlte::components.form.options');
49
    }
50
}
51