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

SwapRule   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 10
c 1
b 0
f 0
dl 0
loc 32
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getSwapToDay() 0 3 1
A getDirection() 0 3 1
A __construct() 0 5 1
A getSwapWhenDays() 0 3 1
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