SwapRule::getSwapToDay()   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
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
	/** @var SwapDirection */
16
	private $swapDirection;
17
18
	/** @var GregorianWeekday */
19
	private $swapToDay;
20
21
	/** @var GregorianWeekday[] */
22
	private $swapWhenDay;
23
24
	public function __construct(SwapDirection $direction, GregorianWeekday $swapToGregorianDay, GregorianWeekday ...$swapWhenGregorianDay)
25
	{
26
		$this->swapDirection = $direction;
27
		$this->swapToDay = $swapToGregorianDay;
28
		$this->swapWhenDay = $swapWhenGregorianDay;
29
	}
30
31
	public function getDirection(): SwapDirection
32
	{
33
		return $this->swapDirection;
34
	}
35
36
	public function getSwapToDay(): GregorianWeekday
37
	{
38
		return $this->swapToDay;
39
	}
40
41
	/**
42
	 * @return GregorianWeekday[]
43
	 */
44
	public function getSwapWhenDays(): array
45
	{
46
		return $this->swapWhenDay;
47
	}
48
}
49