Passed
Pull Request — master (#856)
by Florian
03:57
created

DateRange::render()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace JeroenNoten\LaravelAdminLte\Components;
4
5
class DateRange extends InputGroupComponent
6
{
7
    /**
8
     * The DateRangePicker plugin configuration parameters. Array with
9
     * key => value pairs, where the key should be an existing configuration
10
     * property of the plugin.
11
     *
12
     * @var array
13
     */
14
    public $config;
15
16
    /**
17
     * Enables a default set of ranges option. The string value, if any, will
18
     * be used as the initial date range. The available values are: 'Today',
19
     * 'Yesterday', 'Last 7 Days', 'Last 30 Days', 'This Month' or 'Last Month'.
20
     *
21
     * @var bool|string
22
     */
23
    public $enableDefaultRanges;
24
25
    /**
26
     * Create a new component instance.
27
     * Note this component requires the 'DateRangePicker' and 'Moment' plugins.
28
     *
29
     * @return void
30
     */
31 1
    public function __construct(
32
        $name, $label = null, $size = null, $labelClass = null,
33
        $topClass = null, $inputGroupClass = null, $disableFeedback = null,
34
        $config = [], $enableDefaultRanges = null
35
    ) {
36 1
        parent::__construct(
37 1
            $name, $label, $size, $labelClass, $topClass,
38
            $inputGroupClass, $disableFeedback
39
        );
40
41 1
        $this->config = is_array($config) ? $config : [];
42 1
        $this->enableDefaultRanges = $enableDefaultRanges;
43 1
    }
44
45
    /**
46
     * Get the view / contents that represent the component.
47
     *
48
     * @return \Illuminate\View\View|string
49
     */
50 1
    public function render()
51
    {
52 1
        return view('adminlte::components.date-range');
53
    }
54
}
55