DateRange   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 52
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 3 1
A __construct() 0 14 2
1
<?php
2
3
namespace JeroenNoten\LaravelAdminLte\View\Components\Form;
4
5
class DateRange extends InputGroupComponent
6
{
7
    use Traits\OldValueSupportTrait;
8
9
    /**
10
     * The DateRangePicker plugin configuration parameters. Array with
11
     * 'key => value' pairs, where the key should be an existing configuration
12
     * property of the plugin.
13
     *
14
     * @var array
15
     */
16
    public $config;
17
18
    /**
19
     * Enables a default set of ranges option. The string value, if any, will
20
     * be used as the initial date range. The available values are: 'Today',
21
     * 'Yesterday', 'Last 7 Days', 'Last 30 Days', 'This Month' or 'Last Month'.
22
     *
23
     * @var bool|string
24
     */
25
    public $enableDefaultRanges;
26
27
    /**
28
     * Create a new component instance.
29
     * Note this component requires the 'DateRangePicker' and 'Moment' plugins.
30
     *
31
     * @return void
32
     */
33 3
    public function __construct(
34
        $name, $id = null, $label = null, $igroupSize = null, $labelClass = null,
35
        $fgroupClass = null, $igroupClass = null, $disableFeedback = null,
36
        $errorKey = null, $config = [], $enableDefaultRanges = null,
37
        $enableOldSupport = null
38
    ) {
39 3
        parent::__construct(
40 3
            $name, $id, $label, $igroupSize, $labelClass, $fgroupClass,
41 3
            $igroupClass, $disableFeedback, $errorKey
42 3
        );
43
44 3
        $this->config = is_array($config) ? $config : [];
45 3
        $this->enableDefaultRanges = $enableDefaultRanges;
46 3
        $this->enableOldSupport = isset($enableOldSupport);
47
    }
48
49
    /**
50
     * Get the view / contents that represent the component.
51
     *
52
     * @return \Illuminate\View\View|string
53
     */
54 1
    public function render()
55
    {
56 1
        return view('adminlte::components.form.date-range');
57
    }
58
}
59