| Total Complexity | 12 |
| Total Lines | 96 |
| 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 | 1 | public function hasStartTime(): bool |
|
| 33 | { |
||
| 34 | 1 | return false; |
|
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * {@inheritdoc} |
||
| 39 | */ |
||
| 40 | 1 | public function hasEndTime(): bool |
|
| 41 | { |
||
| 42 | 1 | return false; |
|
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * {@inheritdoc} |
||
| 47 | */ |
||
| 48 | 1 | public function getStartTime(): DateTimeInterface |
|
| 49 | { |
||
| 50 | 1 | throw new DateRangeException('Date range is undefined'); |
|
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * {@inheritdoc} |
||
| 55 | */ |
||
| 56 | 1 | public function getEndTime(): DateTimeInterface |
|
| 57 | { |
||
| 58 | 1 | throw new DateRangeException('Date range is undefined'); |
|
| 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 |
|
| 73 | { |
||
| 74 | 3 | return new InfiniteStartRange($time); |
|
| 75 | } |
||
| 76 | |||
| 77 | /** |
||
| 78 | * {@inheritdoc} |
||
| 79 | */ |
||
| 80 | 2 | public function isStartedAt(DateTimeInterface $time): bool |
|
| 81 | { |
||
| 82 | 2 | return false; |
|
| 83 | } |
||
| 84 | |||
| 85 | /** |
||
| 86 | * {@inheritdoc} |
||
| 87 | */ |
||
| 88 | 2 | public function isEndedAt(DateTimeInterface $time): bool |
|
| 89 | { |
||
| 90 | 2 | return false; |
|
| 91 | } |
||
| 92 | |||
| 93 | /** |
||
| 94 | * {@inheritdoc} |
||
| 95 | */ |
||
| 96 | 1 | public function isStarted(): bool |
|
| 99 | } |
||
| 100 | |||
| 101 | /** |
||
| 102 | * {@inheritdoc} |
||
| 103 | */ |
||
| 104 | 2 | public function isEnded(): bool |
|
| 105 | { |
||
| 107 | } |
||
| 108 | } |
||
| 109 |