Filter::getDate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php declare(strict_types = 1);
2
3
namespace Suilven\CovidAPIClient\Filter;
4
5
use Suilven\CovidAPIClient\Factory\AreaTypeFactory;
6
7
/**
8
 * Class Filter
9
 *
10
 * @package Suilven\CovidAPIClient\Filter
11
 */
12
class Filter
13
{
14
    /** @var \Suilven\CovidAPIClient\Filter\AreaType */
15
    private $areaType;
16
17
    /** @var string|null */
18
    private $areaName;
19
20
    /** @var string|null */
21
    private $areaCode;
22
23
    /** @var string|null */
24
    private $date;
25
26
    public function __construct()
27
    {
28
        // initialise area type as this is mandatory
29
        $factory = new AreaTypeFactory();
30
        $this->areaType = $factory->getAreaType(AreaType::NATION);
31
    }
32
33
34
    public function getAreaType(): AreaType
35
    {
36
        return $this->areaType;
37
    }
38
39
40
    public function setAreaType(AreaType $areaType): void
41
    {
42
        $this->areaType = $areaType;
43
    }
44
45
46
    public function getAreaName(): ?string
47
    {
48
        return $this->areaName;
49
    }
50
51
52
    public function setAreaName(string $areaName): void
53
    {
54
        $this->areaName = $areaName;
55
    }
56
57
58
    public function getAreaCode(): ?string
59
    {
60
        return $this->areaCode;
61
    }
62
63
64
    public function setAreaCode(string $areaCode): void
65
    {
66
        $this->areaCode = $areaCode;
67
    }
68
69
70
    public function getDate(): ?string
71
    {
72
        return $this->date;
73
    }
74
75
76
    public function setDate(string $date): void
77
    {
78
        $this->date = $date;
79
    }
80
}
81