WinterSales::init()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 17
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 11
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 17
rs 9.9
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\Region\Belgium;
12
13
use Carbon\Carbon;
14
use Handelsgids\SalesPeriods\AbstractSalesPeriod;
15
16
class WinterSales extends AbstractSalesPeriod
17
{
18
    public function init(): void
19
    {
20
        $this->setName('Winter sales');
21
        $this->setName('Wintersolden', 'nl');
22
        $this->setName('Soldes d\'hiver', 'fr');
23
24
        $startDate = new Carbon($this->getYear() . '-01-03');
25
        if ($startDate->dayOfWeekIso === 7) {
26
            $startDate = $startDate->subDay();
27
        }
28
        $this->setStartDate($startDate);
29
30
        $endDate = new Carbon($this->getYear() . '-01-31');
31
        $this->setEndDate($endDate);
32
33
        $this->setSalesRegulationsUrl(
34
            'https://economie.fgov.be/nl/themas/verkoop/vormen-van-verkoop/solden-koopjes'
35
        );
36
    }
37
}
38