Total Complexity | 3 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
21 | class WeekDays implements PeriodSignature, WeekDaysSignature |
||
22 | { |
||
23 | /** @var int|string */ |
||
24 | private $numberOfYearsOn; |
||
25 | |||
26 | /** @var array */ |
||
27 | private $monthToCover; |
||
28 | |||
29 | /** |
||
30 | * WeekDays constructor. |
||
31 | * |
||
32 | * @param string $numberOfYearsOn |
||
33 | * @param string $monthToCover |
||
34 | */ |
||
35 | public function __construct( |
||
36 | string $numberOfYearsOn, |
||
37 | string $monthToCover |
||
38 | ) { |
||
39 | $this->numberOfYearsOn = $numberOfYearsOn ?? 1; |
||
40 | $this->monthToCover = $monthToCover ? explode(',', $monthToCover) : [ |
||
41 | 1, |
||
42 | 12, |
||
43 | ]; |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * @inheritDoc |
||
48 | */ |
||
49 | public function extract(array $data): DatePeriod |
||
59 | ); |
||
60 | } |
||
62 |