Passed
Pull Request — 2.x (#1360)
by Harings
11:27
created

DatePicker   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 29 1
A render() 0 3 1
1
<?php
2
3
namespace A17\Twill\View\Components;
4
5
class DatePicker extends TwillFormComponent
6
{
7
    public $withTime;
8
    public $allowInput;
9
    public $allowClear;
10
    public $note;
11
    public $inModal;
12
    public $timeOnly;
13
    public $placeholder;
14
    public $required;
15
    public $time24Hr;
16
    public $altFormat;
17
    public $hourIncrement;
18
    public $minuteIncrement;
19
20
    public function __construct(
21
        $name,
22
        $label,
23
        $withTime = true,
24
        $allowInput = false,
25
        $allowClear = false,
26
        $note = null,
27
        $inModal = false,
28
        $placeholder = '',
29
        $timeOnly = false,
30
        $required = false,
31
        $time24Hr = false,
32
        $altFormat = null,
33
        $hourIncrement = null,
34
        $minuteIncrement = null
35
    ) {
36
        parent::__construct($name, $label);
37
        $this->withTime = $withTime;
38
        $this->allowInput = $allowInput;
39
        $this->allowClear = $allowClear;
40
        $this->note = $note;
41
        $this->inModal = $inModal;
42
        $this->timeOnly = $timeOnly;
43
        $this->placeholder = $placeholder;
44
        $this->required = $required;
45
        $this->time24Hr = $time24Hr;
46
        $this->altFormat = $altFormat;
47
        $this->hourIncrement = $hourIncrement;
48
        $this->minuteIncrement = $minuteIncrement;
49
    }
50
51
    public function render()
52
    {
53
        return view('twill::partials.form._date_picker');
54
    }
55
}
56