Completed
Push — master ( db8d28...797ef7 )
by wen
11:20
created

DateRange   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

3 Methods

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