Passed
Pull Request — master (#721)
by Florian
05:48
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 2
Bugs 1 Features 0
Metric Value
cc 1
eloc 1
c 2
b 1
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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, $disableFeedback = null, $config = [],
34
        $enableDefaultRanges = null
35
    ) {
36 1
        parent::__construct(
37 1
            $name, $label, $size, $labelClass, $topClass, $disableFeedback
38
        );
39
40 1
        $this->config = is_array($config) ? $config : [];
41 1
        $this->enableDefaultRanges = $enableDefaultRanges;
42 1
    }
43
44
    /**
45
     * Get the view / contents that represent the component.
46
     *
47
     * @return \Illuminate\View\View|string
48
     */
49 1
    public function render()
50
    {
51 1
        return view('adminlte::components.date-range');
52
    }
53
}
54