Completed
Push — main ( ec0f68...b41cf0 )
by Andreas
14s queued 12s
created

SwapRule::getSwapToDay()   A

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
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * Copyright Andreas Heigl <[email protected]>
5
 *
6
 * Licenses under the MIT-license. For details see the included file LICENSE.md
7
 */
8
9
declare(strict_types=1);
10
11
namespace Org_Heigl\Holidaychecker;
12
13
class SwapRule
14
{
15
	private $swapDirection;
16
17
	private $swapToDay;
18
19
	/** @var GregorianWeekday[] */
20
	private $swapWhenDay;
21
22
	/**
23
	 * @param GregorianWeekday[] $swapWhenGregorianDay
24
	 */
25
	public function __construct(SwapDirection $direction, GregorianWeekday $swapToGregorianDay, GregorianWeekday ...$swapWhenGregorianDay)
26
	{
27
		$this->swapDirection = $direction;
28
		$this->swapToDay = $swapToGregorianDay;
29
		$this->swapWhenDay = $swapWhenGregorianDay;
30
	}
31
32
	public function getDirection(): SwapDirection
33
	{
34
		return $this->swapDirection;
35
	}
36
37
	public function getSwapToDay(): GregorianWeekday
38
	{
39
		return $this->swapToDay;
40
	}
41
42
	public function getSwapWhenDays(): array
43
	{
44
		return $this->swapWhenDay;
45
	}
46
}
47