SalesPeriod   A
last analyzed

Complexity

Total Complexity 12

Size/Duplication

Total Lines 105
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 20
c 1
b 0
f 0
dl 0
loc 105
rs 10
wmc 12

10 Methods

Rating   Name   Duplication   Size   Complexity  
A getSalesRegulationsUrl() 0 3 1
A setName() 0 7 2
A setEndDate() 0 3 1
A setSalesRegulationsUrl() 0 3 1
A getEndDate() 0 3 1
A getStartDate() 0 3 1
A setRegion() 0 3 1
A setStartDate() 0 3 1
A getRegion() 0 3 1
A getName() 0 7 2
1
<?php
2
/**
3
 * This file is part of handelsgids/sales-periods.
4
 *
5
 * (c) Handelsgids NV
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Handelsgids\SalesPeriods\Model;
12
13
use Carbon\Carbon;
14
15
class SalesPeriod
16
{
17
    /** @var string[] */
18
    private $name;
19
20
    /** @var Carbon */
21
    private $startDate;
22
23
    /** @var Carbon */
24
    private $endDate;
25
26
    /** @var string */
27
    private $salesRegulationsUrl;
28
29
    /** @var string */
30
    private $region;
31
32
    /**
33
     * @param string $locale
34
     * @return string
35
     */
36
    public function getName($locale = null)
37
    {
38
        if ($locale === null) {
39
            $locale = 'en';
40
        }
41
42
        return $this->name[$locale];
43
    }
44
45
    /**
46
     * @param string $name
47
     * @param string $locale
48
     */
49
    public function setName($name, $locale = null): void
50
    {
51
        if ($locale === null) {
52
            $locale = 'en';
53
        }
54
55
        $this->name[$locale] = $name;
56
    }
57
58
    /**
59
     * @return Carbon
60
     */
61
    public function getStartDate()
62
    {
63
        return $this->startDate;
64
    }
65
66
    /**
67
     * @param Carbon $startDate
68
     */
69
    protected function setStartDate($startDate): void
70
    {
71
        $this->startDate = $startDate;
72
    }
73
74
    /**
75
     * @return Carbon
76
     */
77
    public function getEndDate()
78
    {
79
        return $this->endDate;
80
    }
81
82
    /**
83
     * @param Carbon $endDate
84
     */
85
    protected function setEndDate($endDate): void
86
    {
87
        $this->endDate = $endDate;
88
    }
89
90
    /**
91
     * @return string
92
     */
93
    public function getSalesRegulationsUrl()
94
    {
95
        return $this->salesRegulationsUrl;
96
    }
97
98
    /**
99
     * @param string $salesRegulationsUrl
100
     */
101
    public function setSalesRegulationsUrl($salesRegulationsUrl): void
102
    {
103
        $this->salesRegulationsUrl = $salesRegulationsUrl;
104
    }
105
106
    /**
107
     * @return string
108
     */
109
    public function getRegion()
110
    {
111
        return $this->region;
112
    }
113
114
    /**
115
     * @param string $region
116
     */
117
    public function setRegion($region): void
118
    {
119
        $this->region = $region;
120
    }
121
}
122