Total Complexity | 10 |
Total Lines | 80 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
11 | class UndefinedRange implements RangeState |
||
12 | { |
||
13 | /** |
||
14 | * {@inheritdoc} |
||
15 | */ |
||
16 | 1 | public function __toString(): string |
|
17 | { |
||
18 | 1 | return '-/-'; |
|
19 | } |
||
20 | |||
21 | /** |
||
22 | * {@inheritdoc} |
||
23 | */ |
||
24 | 1 | public function jsonSerialize(): array |
|
25 | { |
||
26 | 1 | return ['startTime' => null, 'endTime' => null]; |
|
27 | } |
||
28 | |||
29 | /** |
||
30 | * {@inheritdoc} |
||
31 | */ |
||
32 | 2 | public function hasStartTime(): bool |
|
35 | } |
||
36 | |||
37 | /** |
||
38 | * {@inheritdoc} |
||
39 | */ |
||
40 | 2 | public function hasEndTime(): bool |
|
41 | { |
||
42 | 2 | return false; |
|
43 | } |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | 2 | public function getStartTime(): DateTimeInterface |
|
49 | { |
||
50 | 2 | throw new DateRangeException('Range start is undefined'); |
|
51 | } |
||
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | 2 | public function getEndTime(): DateTimeInterface |
|
59 | } |
||
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | 7 | public function setStartTime(DateTimeInterface $time): RangeState |
|
65 | { |
||
66 | 7 | return new InfiniteEndRange($time); |
|
67 | } |
||
68 | |||
69 | /** |
||
70 | * {@inheritdoc} |
||
71 | */ |
||
72 | 3 | public function setEndTime(DateTimeInterface $time): RangeState |
|
75 | } |
||
76 | |||
77 | /** |
||
78 | * {@inheritdoc} |
||
79 | */ |
||
80 | 1 | public function compareStartTime(DateTimeInterface $time): int |
|
81 | { |
||
82 | 1 | throw new DateRangeException('Range start is undefined'); |
|
83 | } |
||
84 | |||
85 | /** |
||
86 | * {@inheritdoc} |
||
87 | */ |
||
88 | 1 | public function compareEndTime(DateTimeInterface $time): int |
|
91 | } |
||
92 | } |
||
93 |