Completed
Push — master ( 650783...0c9838 )
by wen
15:06
created

DateRange   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 37
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getPickerFormat() 0 4 1
A setPickerFormat() 0 6 1
A toArray() 0 6 1
1
<?php
2
3
namespace Sco\Admin\Display\Filters;
4
5
class DateRange extends Filter
6
{
7
    protected $type = 'daterange';
8
9
    protected $pickerFormat = 'yyyy-MM-dd';
10
11
    protected $defaultValue = [];
12
13
    protected $operator = 'between';
14
15
    /**
16
     * @return string
17
     */
18
    public function getPickerFormat(): string
19
    {
20
        return $this->pickerFormat;
21
    }
22
23
    /**
24
     * @param string $pickerFormat
25
     *
26
     * @return DateRange
27
     */
28
    public function setPickerFormat(string $pickerFormat): DateRange
29
    {
30
        $this->pickerFormat = $pickerFormat;
31
32
        return $this;
33
    }
34
35
    public function toArray()
36
    {
37
        return parent::toArray() + [
38
                'pickerFormat' => $this->getPickerFormat(),
39
            ];
40
    }
41
}
42